Browse Source

rev 混料机下工单依旧使用物料号

master
张江玮 2 years ago
parent
commit
01b9073569
  1. 12
      lms/nladmin-system/pom.xml
  2. 62
      lms/nladmin-system/src/main/java/org/nl/config/DataBaseConfig.java
  3. 22
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/service/dto/MaterialbaseDto.java
  4. 105
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/service/impl/MaterialbaseServiceImpl.java
  5. 30
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/wql/QMD_ME_MATERIAL.wql
  6. 2
      lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java
  7. 1
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/empty/wql/CALL_EMPTY_TASK.wql
  8. 7
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/material/wql/CALL_MATERIAL_TASK.wql
  9. 4
      lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/wql/SEND_MATERIAL_TASK.wql
  10. BIN
      lms/nladmin-system/src/main/java/org/nl/wms/wms.xls
  11. 8
      lms/nladmin-system/src/main/resources/config/application-prod.yml
  12. 99
      lms/nladmin-system/src/test/java/org/nl/test/TempTest.java
  13. 4
      lms/nladmin-ui/src/views/wms/basedata/bom/index.vue
  14. 92
      lms/nladmin-ui/src/views/wms/basedata/material/index.vue
  15. 30
      lms/nladmin-ui/src/views/wms/pdm/workerorder/hl/index.vue
  16. 2
      lms/nladmin-ui/src/views/wms/pdm/workerorder/index.vue
  17. 2
      lms/nladmin-ui/src/views/wms/pub/BOMDialog.vue
  18. 24
      lms/nladmin-ui/src/views/wms/pub/MaterDialog.vue
  19. 2
      lms/nladmin-ui/src/views/wms/sch/point/index.vue

12
lms/nladmin-system/pom.xml

@ -31,6 +31,16 @@
</properties> </properties>
<dependencies> <dependencies>
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.4.0.jre8</version>
</dependency>
<dependency> <dependency>
<groupId>org.redisson</groupId> <groupId>org.redisson</groupId>
<artifactId>redisson-spring-boot-starter</artifactId> <artifactId>redisson-spring-boot-starter</artifactId>
@ -270,7 +280,7 @@
<dependency> <dependency>
<groupId>commons-beanutils</groupId> <groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils-core</artifactId> <artifactId>commons-beanutils-core</artifactId>
<version>1.8.0</version> <version>1.8.3</version>
</dependency> </dependency>
<dependency> <dependency>

62
lms/nladmin-system/src/main/java/org/nl/config/DataBaseConfig.java

@ -1,18 +1,33 @@
package org.nl.config; package org.nl.config;
import cn.hutool.core.util.StrUtil;
import com.alibaba.druid.pool.DruidDataSource; import com.alibaba.druid.pool.DruidDataSource;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.modules.mnt.util.DataTypeEnum;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
import javax.sql.DataSource; import javax.sql.DataSource;
import java.sql.DriverManager;
import java.sql.SQLException;
@Configuration @Configuration
@Slf4j @Slf4j
public class DataBaseConfig { public class DataBaseConfig {
@Value("${erp.sqlserver.enabled}")
private boolean sqlserverIsConnect;
@Value("${erp.sqlserver.jdbcurl}")
private String sqlserverJdbcUrl;
@Value("${erp.sqlserver.username}")
private String sqlserverUserName;
@Value("${erp.sqlserver.password}")
private String sqlserverPassword;
@Primary @Primary
@Bean(name = "dataSource") @Bean(name = "dataSource")
@ConfigurationProperties(prefix = "spring.datasource.druid") @ConfigurationProperties(prefix = "spring.datasource.druid")
@ -20,4 +35,51 @@ public class DataBaseConfig {
return new DruidDataSource(); return new DruidDataSource();
} }
@Bean("dataSource1")
@ConditionalOnExpression("${erp.sqlserver.enabled:true}")
public DataSource dataSource1() {
log.info("是否连接Sqlserver" + sqlserverIsConnect);
String jdbcUrl = sqlserverJdbcUrl;
String userName = sqlserverUserName;
String password = sqlserverPassword;
DruidDataSource druidDataSource = new DruidDataSource();
String className;
try {
className = DriverManager.getDriver(jdbcUrl.trim()).getClass().getName();
} catch (SQLException e) {
throw new RuntimeException("Get class name error: =" + jdbcUrl);
}
if (StrUtil.isEmpty(className)) {
DataTypeEnum dataTypeEnum = DataTypeEnum.urlOf(jdbcUrl);
if (null == dataTypeEnum) {
throw new RuntimeException("Not supported data type: jdbcUrl=" + jdbcUrl);
}
druidDataSource.setDriverClassName(dataTypeEnum.getDriver());
} else {
druidDataSource.setDriverClassName(className);
}
druidDataSource.setUrl(jdbcUrl);
druidDataSource.setUsername(userName);
druidDataSource.setPassword(password);
// 配置获取连接等待超时的时间
druidDataSource.setMaxWait(3000);
// 配置初始化大小、最小、最大
druidDataSource.setInitialSize(5);
druidDataSource.setMinIdle(5);
druidDataSource.setMaxActive(10);
// 如果链接出现异常则直接判定为失败而不是一直重试
druidDataSource.setBreakAfterAcquireFailure(true);
try {
druidDataSource.init();
} catch (SQLException e) {
log.error("Exception during pool initialization", e);
throw new RuntimeException(e.getMessage());
}
return druidDataSource;
}
} }

22
lms/nladmin-system/src/main/java/org/nl/wms/basedata/service/dto/MaterialbaseDto.java

@ -50,11 +50,29 @@ public class MaterialbaseDto implements Serializable {
private String update_time; private String update_time;
/** /**
* 是否启用 * 是否删除
*/ */
private String is_used; private String is_delete;
private Double weight; private Double weight;
private String material_type; private String material_type;
private Double qty;
private Double aux_qty;
private Double current_qty;
private Double current_aux_qty;
private String order_code;
private String furnace;
private String material_brick_type;
private String product_grade;
private Double unqualified_qty;
} }

105
lms/nladmin-system/src/main/java/org/nl/wms/basedata/service/impl/MaterialbaseServiceImpl.java

@ -30,6 +30,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors;
/** /**
* @author zhouz * @author zhouz
@ -51,6 +52,9 @@ public class MaterialbaseServiceImpl implements MaterialbaseService {
map.put("flag", "1"); map.put("flag", "1");
map.put("search", name); map.put("search", name);
map.put("material_type", MapUtil.getStr(whereJson, "material_type")); map.put("material_type", MapUtil.getStr(whereJson, "material_type"));
map.put("order_code", MapUtil.getStr(whereJson, "order_code"));
map.put("product_grade", MapUtil.getStr(whereJson, "product_grade"));
map.put("brick_type", MapUtil.getStr(whereJson, "brick_type"));
return WQL.getWO("QMD_ME_MATERIAL").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "create_time DESC"); return WQL.getWO("QMD_ME_MATERIAL").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "create_time DESC");
} }
@ -106,52 +110,6 @@ public class MaterialbaseServiceImpl implements MaterialbaseService {
dto.setCreate_time(now); dto.setCreate_time(now);
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto)); JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
wo.insert(json); wo.insert(json);
// 解析物料编码
JSONObject material_detail = new JSONObject();
material_detail.put("material_id", id);
material_detail.put("material_code", material_code);
WQLObject dict_detail_table = WQLObject.getWQLObject("sys_dict_detail");
String furnace_code = material_code.substring(0, 2);
JSONObject furnace_name = dict_detail_table.query("name = 'furnace' AND value = '" + furnace_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(furnace_name)) {
throw new BadRequestException("物料编码解析错误:未知炉型!");
}
material_detail.put("furnace", furnace_name.getString("label"));
String material_brick_code = material_code.substring(2, 5);
JSONObject material_brick_type = dict_detail_table.query("name = 'material_brick_type' AND value = '" + material_brick_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(material_brick_type)) {
throw new BadRequestException("物料编码解析错误:未知物料砖类型!");
}
material_detail.put("material_brick_type", material_brick_type.getString("label"));
String bom_code = material_code.substring(5, 11);
JSONObject old_bom = wo.query("material_code = '" + bom_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(old_bom)) {
JSONObject bom = new JSONObject();
bom.put("material_id", IdUtil.getSnowflake(1, 1).nextId());
bom.put("material_code", bom_code);
bom.put("material_type", "2");
bom.put("create_id", currentUserId);
bom.put("create_name", nickName);
bom.put("create_time", now);
wo.insert(bom);
}
material_detail.put("bom_code", bom_code);
material_detail.put("order_code", material_code.substring(11, 16));
material_detail.put("customer_code", material_code.substring(16, 21));
String product_grade_code = material_code.substring(21, 23);
JSONObject product_grade = dict_detail_table.query("name = 'product_grade' AND value = '" + product_grade_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(product_grade)) {
throw new BadRequestException("物料编码解析错误:未知牌号!");
}
material_detail.put("product_grade", product_grade.getString("label"));
material_detail.put("brick_type", material_code.substring(23));
material_detail.put("create_id", currentUserId);
material_detail.put("create_name", nickName);
material_detail.put("create_time", now);
WQLObject.getWQLObject("md_me_material_detail").insert(material_detail);
} }
@Override @Override
@ -199,8 +157,59 @@ public class MaterialbaseServiceImpl implements MaterialbaseService {
@Override @Override
public void synchronize(Map whereJson) { public void synchronize(Map whereJson) {
/* wmsToErpService.getClassInfo(null); JSONArray erp_materials = WQL.getWO("QMD_ME_MATERIAL").setDbname("dataSource1").addParam("flag", "2").process().getResultJSONArray(0);
wmsToErpService.getMaterialInfo(null);*/ if (ObjectUtil.isNotEmpty(erp_materials)) {
WQLObject material_table = WQLObject.getWQLObject("md_me_materialbase");
List<String> material_codes = material_table.query().getResultJSONArray(0).stream().map(o -> ((JSONObject) o).getString("material_code")).collect(Collectors.toList());
WQLObject dict_detail_table = WQLObject.getWQLObject("sys_dict_detail");
Long user_id = SecurityUtils.getCurrentUserId();
String nick_name = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
erp_materials.forEach(o -> {
JSONObject erp_material = (JSONObject) o;
String material_code = erp_material.getString("cinvcode").substring(1);
if (!material_codes.contains(material_code)) {
JSONObject material = new JSONObject();
long id = IdUtil.getSnowflake(1L, 1L).nextId();
material.put("material_id", id);
material.put("material_code", material_code);
material.put("material_name", erp_material.getString("cinvname"));
material.put("weight", String.format("%.2f", erp_material.getDoubleValue("changerate") * 1000));
String qty = String.format("%.0f", erp_material.getDoubleValue("qty") * 1000);
material.put("qty", qty);
material.put("surplus_qty", qty);
String aux_qty = String.format("%.0f", erp_material.getDoubleValue("auxqty"));
material.put("aux_qty", aux_qty);
material.put("surplus_aux_qty", aux_qty);
material.put("order_code", erp_material.getString("free1"));
String furnace_code = material_code.substring(0, 2);
JSONObject furnace_name = dict_detail_table.query("name = 'furnace' AND value = '" + furnace_code + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(furnace_name)) {
material.put("furnace", furnace_name.getString("label"));
} else {
material.put("furnace", furnace_code);
}
String material_brick_code = material_code.substring(2, 5);
JSONObject material_brick_type = dict_detail_table.query("name = 'material_brick_type' AND value = '" + material_brick_code + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(material_brick_type)) {
material.put("material_brick_type", material_brick_type.getString("label"));
} else {
material.put("material_brick_type", material_brick_code);
}
material.put("product_grade", erp_material.getString("free3"));
material.put("brick_type", erp_material.getString("free4"));
material.put("create_id", user_id);
material.put("create_name", nick_name);
material.put("create_time", now);
material_table.insert(material);
}
});
}
} }
@Override @Override

30
lms/nladmin-system/src/main/java/org/nl/wms/basedata/wql/QMD_ME_MATERIAL.wql

@ -18,7 +18,10 @@
输入.class_code TYPEAS s_string 输入.class_code TYPEAS s_string
输入.idssql TYPEAS f_string 输入.idssql TYPEAS f_string
输入.classIds TYPEAS f_string 输入.classIds TYPEAS f_string
输入.material_type TYPEAS f_string 输入.material_type TYPEAS s_string
输入.order_code TYPEAS s_string
输入.product_grade TYPEAS s_string
输入.brick_type TYPEAS s_string
[临时表] [临时表]
--这边列出来的临时表就会在运行期动态创建 --这边列出来的临时表就会在运行期动态创建
@ -55,10 +58,31 @@
ENDOPTION ENDOPTION
OPTION 输入.material_type <> "" OPTION 输入.material_type <> ""
mb.material_type = 输入.material_type mb.material_type = 输入.material_type
ENDOPTION
OPTION 输入.order_code <> ""
mb.order_code LIKE '%' order_code '%'
ENDOPTION
OPTION 输入.product_grade <> ""
mb.product_grade LIKE '%' 输入.product_grade '%'
ENDOPTION
OPTION 输入.brick_type <> ""
mb.brick_type LIKE '%' 输入.brick_type '%'
ENDOPTION ENDOPTION
ENDSELECT ENDSELECT
ENDPAGEQUERY ENDPAGEQUERY
ENDIF ENDIF
IF 输入.flag = "2"
QUERY
SELECT
*
FROM
dbo.EFV_MO_ORDER
WHERE
STATUS = 3
AND AuxQty > QualifiedInNum
AND LEFT ( cinvcode, 1 ) <> '1'
AND cInvCode LIKE 'W%'
ENDSELECT
ENDQUERY
ENDIF

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

@ -915,7 +915,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
throw new BadRequestException("载具编码不能为空!"); throw new BadRequestException("载具编码不能为空!");
} }
boolean to_package = false; boolean to_package = true;
WQLObject vd_table = WQLObject.getWQLObject("st_ivt_vehicle_detail"); WQLObject vd_table = WQLObject.getWQLObject("st_ivt_vehicle_detail");
JSONObject vd = vd_table JSONObject vd = vd_table

1
lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/empty/wql/CALL_EMPTY_TASK.wql

@ -56,6 +56,7 @@
AND vd.is_delete = '0' AND vd.is_delete = '0'
AND vd.point_code = 输入.point_code AND vd.point_code = 输入.point_code
AND vd.is_full = '0' AND vd.is_full = '0'
AND vd.is_in_kiln = '0'
ENDSELECT ENDSELECT
ENDQUERY ENDQUERY
ENDIF ENDIF

7
lms/nladmin-system/src/main/java/org/nl/wms/sch/task/call/material/wql/CALL_MATERIAL_TASK.wql

@ -116,9 +116,6 @@
AND point.vehicle_code = vd.vehicle_code AND point.vehicle_code = vd.vehicle_code
AND vd.is_delete = '0' AND vd.is_delete = '0'
LEFT JOIN md_me_materialbase mb1 ON vd.material_id = mb1.material_id LEFT JOIN md_me_materialbase mb1 ON vd.material_id = mb1.material_id
LEFT JOIN md_me_material_detail md ON mb1.material_code = md.bom_code
LEFT JOIN md_me_materialbase mb2 ON md.material_id = mb2.material_id
LEFT JOIN pdm_bd_workorder workorder ON vd.workorder_id = workorder.workorder_id
WHERE WHERE
point.is_used = '1' point.is_used = '1'
AND point.lock_type = '1' AND point.lock_type = '1'
@ -126,10 +123,10 @@
AND point.point_type = '1' AND point.point_type = '1'
AND point.point_status = '1' AND point.point_status = '1'
AND point.vehicle_type = '1' AND point.vehicle_type = '1'
AND mb2.material_id = 输入.material_id AND mb1.material_id = 输入.material_id
AND vd.stand_status IN ('3', '4') AND vd.stand_status IN ('3', '4')
ORDER BY ORDER BY
workorder.is_urgent DESC, vd.create_time ASC vd.create_time ASC
ENDSELECT ENDSELECT
ENDQUERY ENDQUERY
ENDIF ENDIF

4
lms/nladmin-system/src/main/java/org/nl/wms/sch/task/send/material/wql/SEND_MATERIAL_TASK.wql

@ -109,15 +109,13 @@
JOIN pdm_bi_device device ON point.device_code = device.device_code JOIN pdm_bi_device device ON point.device_code = device.device_code
LEFT JOIN pdm_bd_workorder workorder ON device.device_id = workorder.device_id AND workorder.order_status = '3' LEFT JOIN pdm_bd_workorder workorder ON device.device_id = workorder.device_id AND workorder.order_status = '3'
LEFT JOIN md_me_materialbase mb1 ON workorder.material_id = mb1.material_id AND mb1.material_type = '1' LEFT JOIN md_me_materialbase mb1 ON workorder.material_id = mb1.material_id AND mb1.material_type = '1'
LEFT JOIN md_me_material_detail md1 ON mb1.material_id = md1.material_id
LEFT JOIN md_me_materialbase mb2 ON md1.bom_code = mb2.material_code AND mb2.material_type = '2'
WHERE WHERE
point.is_used = '1' point.is_used = '1'
AND point.lock_type = '1' AND point.lock_type = '1'
AND point.region_code = 'KLHJ' AND point.region_code = 'KLHJ'
AND point.point_type = '2' AND point.point_type = '2'
AND point.point_status = '0' AND point.point_status = '0'
AND mb2.material_id = 输入.material_id AND mb1.material_id = 输入.material_id
ENDSELECT ENDSELECT
ENDQUERY ENDQUERY
ENDIF ENDIF

BIN
lms/nladmin-system/src/main/java/org/nl/wms/wms.xls

Binary file not shown.

8
lms/nladmin-system/src/main/resources/config/application-prod.yml

@ -158,3 +158,11 @@ sa-token:
jwt-secret-key: opsjajisdnnca0sdkksdfaaasdfwwq jwt-secret-key: opsjajisdnnca0sdkksdfaaasdfwwq
# token 前缀 # token 前缀
token-prefix: Bearer token-prefix: Bearer
#erp
erp:
sqlserver:
enabled: true
jdbcurl: jdbc:sqlserver://192.168.0.251:1433;DatabaseName=UFDATA_001_2023;
username: rl
password: SH123

99
lms/nladmin-system/src/test/java/org/nl/test/TempTest.java

@ -1,6 +1,5 @@
package org.nl.test; package org.nl.test;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
@ -8,18 +7,14 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.nl.modules.common.utils.CommonUtils; import org.nl.modules.common.utils.SecurityUtils;
import org.nl.modules.wql.WQL; import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject; import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.wms.basedata.eum.StandStatus;
import org.nl.wms.ext.acs.service.WmsToAcsService;
import org.nl.wms.sch.manage.LockType;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
import java.util.ArrayList; import java.util.List;
import java.util.Set; import java.util.stream.Collectors;
/** /**
* @author zhangjiangwei * @author zhangjiangwei
@ -31,58 +26,58 @@ public class TempTest {
@Test @Test
public void test01() { public void test01() {
JSONArray vds = WQL.getWO("MANAGE_QUERY").addParam("flag", "1").process().getResultJSONArray(0); JSONArray erp_materials = WQL.getWO("QMD_ME_MATERIAL").setDbname("dataSource1").addParam("flag", "2").process().getResultJSONArray(0);
if (ObjectUtil.isNotEmpty(erp_materials)) {
WQLObject material_table = WQLObject.getWQLObject("md_me_materialbase");
List<String> material_codes = material_table.query().getResultJSONArray(0).stream().map(o -> ((JSONObject) o).getString("material_code")).collect(Collectors.toList());
WQLObject dict_detail_table = WQLObject.getWQLObject("sys_dict_detail");
if (ObjectUtil.isNotEmpty(vds)) { Long user_id = 1L;
ArrayList<Long> ids = new ArrayList<>(); String nick_name = "管理员";
for (int i = 0; i < vds.size(); i++) { String now = DateUtil.now();
JSONObject vd = vds.getJSONObject(i);
DateTime create_time = DateUtil.parse(vd.getString("create_time"));
DateTime time = DateUtil.offsetMinute(create_time, vd.getIntValue("standing_time"));
int compare = DateUtil.compare(DateUtil.date(), time);
if (compare >= 0) {
ids.add(vd.getLong("vd_id"));
}
}
JSONObject update = new JSONObject();
update.put("stand_status", StandStatus.COMPLETED.value());
WQLObject.getWQLObject("st_ivt_vehicle_detail").update(update, "vd_id IN " + CommonUtils.idsArrayToInStr(ids.toArray(new Long[0])));
}
vds = WQL.getWO("MANAGE_QUERY").addParam("flag", "2").process().getResultJSONArray(0); erp_materials.forEach(o -> {
JSONObject erp_material = (JSONObject) o;
String material_code = erp_material.getString("cinvcode").substring(1);
if (!material_codes.contains(material_code)) {
JSONObject material = new JSONObject();
long id = IdUtil.getSnowflake(1L, 1L).nextId();
material.put("material_id", id);
material.put("material_code", material_code);
material.put("material_name", erp_material.getString("cinvname"));
material.put("weight", String.format("%.2f", erp_material.getDoubleValue("changerate") * 1000));
String qty = String.format("%.0f", erp_material.getDoubleValue("qty") * 1000);
material.put("qty", qty);
material.put("surplus_qty", qty);
String aux_qty = String.format("%.0f", erp_material.getDoubleValue("auxqty"));
material.put("aux_qty", aux_qty);
material.put("surplus_aux_qty", aux_qty);
material.put("order_code", erp_material.getString("free1"));
if (ObjectUtil.isNotEmpty(vds)) { String furnace_code = material_code.substring(0, 2);
ArrayList<Long> ids = new ArrayList<>(); JSONObject furnace_name = dict_detail_table.query("name = 'furnace' AND value = '" + furnace_code + "'").uniqueResult(0);
for (int i = 0; i < vds.size(); i++) { if (ObjectUtil.isNotEmpty(furnace_name)) {
JSONObject vd = vds.getJSONObject(i); material.put("furnace", furnace_name.getString("label"));
DateTime create_time = DateUtil.parse(vd.getString("create_time")); } else {
int threshold_time = vd.getIntValue("threshold_time"); material.put("furnace", furnace_code);
int standing_time = vd.getIntValue("standing_time");
if (threshold_time != 0 && threshold_time < standing_time) {
DateTime time = DateUtil.offsetMinute(create_time, threshold_time);
int compare = DateUtil.compare(DateUtil.date(), time);
if (compare >= 0) {
ids.add(vd.getLong("vd_id"));
}
} }
String material_brick_code = material_code.substring(2, 5);
JSONObject material_brick_type = dict_detail_table.query("name = 'material_brick_type' AND value = '" + material_brick_code + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(material_brick_type)) {
material.put("material_brick_type", material_brick_type.getString("label"));
} else {
material.put("material_brick_type", material_brick_code);
} }
material.put("product_grade", erp_material.getString("free3"));
material.put("brick_type", erp_material.getString("free4"));
if (!ids.isEmpty()) { material.put("create_id", user_id);
JSONObject update = new JSONObject(); material.put("create_name", nick_name);
update.put("stand_status", StandStatus.TIMEOUT.value()); material.put("create_time", now);
WQLObject.getWQLObject("st_ivt_vehicle_detail").update(update, "vd_id IN " + CommonUtils.idsArrayToInStr(ids.toArray(new Long[0])));
}
}
JSONArray points = WQL.getWO("MANAGE_QUERY").addParam("flag", "3").process().getResultJSONArray(0); material_table.insert(material);
if (ObjectUtil.isNotEmpty(vds)) {
JSONArray point_codes = new JSONArray();
for (int i = 0; i < points.size(); i++) {
JSONObject point = points.getJSONObject(i);
point_codes.add(point.getString("point_code"));
} }
SpringContextHolder.getBean(WmsToAcsService.class).light(point_codes); });
} }
} }
} }

4
lms/nladmin-ui/src/views/wms/basedata/bom/index.vue

@ -10,11 +10,11 @@
label-width="90px" label-width="90px"
label-suffix=":" label-suffix=":"
> >
<el-form-item label="BOM编码"> <el-form-item label="物料编码">
<el-input <el-input
v-model="query.name" v-model="query.name"
clearable clearable
placeholder="BOM编码" placeholder="物料编码"
@keyup.enter.native="crud.toQuery" @keyup.enter.native="crud.toQuery"
/> />
</el-form-item> </el-form-item>

92
lms/nladmin-ui/src/views/wms/basedata/material/index.vue

@ -35,17 +35,80 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="物料编码" prop="material_code"> <el-form-item label="物料编码" prop="material_code">
<el-input :disabled="crud.status.edit" v-model="form.material_code" clearable style="width: 300px" /> <el-input v-model="form.material_code" :disabled="crud.status.edit" clearable style="width: 300px" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="单重" prop="weight"> <el-form-item label="订单编码" prop="order_code">
<el-input v-model="form.order_code" :disabled="crud.status.edit" style="width: 300px" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="部位" prop="product_grade">
<el-input v-model="form.product_grade" :disabled="crud.status.edit" style="width: 300px" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="炉型" prop="furnace">
<el-input v-model="form.furnace" :disabled="crud.status.edit" style="width: 300px" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="砖型" prop="brick_type">
<el-input v-model="form.brick_type" :disabled="crud.status.edit" style="width: 300px" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="类别" prop="material_brick_type">
<el-input v-model="form.material_brick_type" :disabled="crud.status.edit" style="width: 300px" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="订单单重" prop="weight">
<el-input v-model="form.weight" type="number" style="width: 300px"><i slot="suffix" style="font-style:normal;margin-right: 10px;">千克</i></el-input> <el-input v-model="form.weight" type="number" style="width: 300px"><i slot="suffix" style="font-style:normal;margin-right: 10px;">千克</i></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :span="12">
<el-form-item label="订单数量" prop="aux_qty">
<el-input v-model="form.aux_qty" type="number" style="width: 300px"><i slot="suffix" style="font-style:normal;margin-right: 10px;"></i></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="订单重量" prop="qty">
<el-input v-model="form.qty" type="number" style="width: 300px"><i slot="suffix" style="font-style:normal;margin-right: 10px;">千克</i></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="困料时间" prop="standing_time">
<el-input v-model="form.standing_time" type="number" style="width: 300px"><i slot="suffix" style="font-style:normal;margin-right: 10px;">分钟</i></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="超时时间" prop="threshold_time">
<el-input v-model="form.threshold_time" type="number" style="width: 300px"><i slot="suffix" style="font-style:normal;margin-right: 10px;">分钟</i></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="产品编号" prop="product_code"> <el-form-item label="产品编号" prop="product_code">
@ -97,7 +160,21 @@
@selection-change="crud.selectionChangeHandler" @selection-change="crud.selectionChangeHandler"
> >
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" /> <el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
<el-table-column prop="weight" label="单重" :min-width="flexWidth('weight',crud.data,'单重')" /> <el-table-column prop="order_code" label="订单编码" :min-width="flexWidth('order_code',crud.data,'订单编码')" />
<el-table-column prop="product_grade" label="部位" :min-width="flexWidth('weight',crud.data,'部位')" />
<el-table-column prop="furnace" label="炉型" :min-width="flexWidth('furnace',crud.data,'炉型')" />
<el-table-column prop="brick_type" label="砖型" :min-width="flexWidth('brick_type',crud.data,'砖型')" />
<el-table-column prop="material_brick_type" label="类别" :min-width="flexWidth('material_brick_type',crud.data,'类别')" />
<el-table-column prop="weight" label="订单单重" :min-width="flexWidth('weight',crud.data,'订单单重')" />
<el-table-column prop="aux_qty" label="订单数量" :min-width="flexWidth('aux_qty',crud.data,'订单数量')" />
<el-table-column prop="qty" label="订单重量" :min-width="flexWidth('qty',crud.data,'订单重量')" />
<el-table-column prop="current_aux_qty" label="完成数量" :min-width="flexWidth('current_aux_qty',crud.data,'完成数量')" />
<el-table-column prop="unqualified_qty" label="废砖数量" :min-width="flexWidth('unqualified_qty',crud.data,'废砖数量')" />
<el-table-column prop="current_qty" label="完成总重" :min-width="flexWidth('current_qty',crud.data,'完成总重')" />
<el-table-column prop="surplus_aux_qty" label="剩余数量" :min-width="flexWidth('surplus_aux_qty',crud.data,'剩余数量')" />
<el-table-column prop="surplus_qty" label="剩余重量" :min-width="flexWidth('surplus_qty',crud.data,'剩余重量')" />
<el-table-column prop="standing_time" label="困料时间" :min-width="flexWidth('standing_time',crud.data,'困料时间')" />
<el-table-column prop="threshold_time" label="超时时间" :min-width="flexWidth('threshold_time',crud.data,'超时时间')" />
<el-table-column prop="product_code" label="产品编号" :min-width="flexWidth('product_code',crud.data,'产品编号')" /> <el-table-column prop="product_code" label="产品编号" :min-width="flexWidth('product_code',crud.data,'产品编号')" />
<el-table-column prop="a" label="长边长度" :min-width="flexWidth('a',crud.data,'长边长度')" /> <el-table-column prop="a" label="长边长度" :min-width="flexWidth('a',crud.data,'长边长度')" />
<el-table-column prop="b" label="短边长度" :min-width="flexWidth('b',crud.data,'短边长度')" /> <el-table-column prop="b" label="短边长度" :min-width="flexWidth('b',crud.data,'短边长度')" />
@ -159,7 +236,14 @@ const defaultForm = {
update_optname: null, update_optname: null,
update_time: null, update_time: null,
weight: null, weight: null,
material_type: '1' material_type: '1',
order_code: null,
product_grade: null,
material_brick_type: null,
furnace: null,
qty: 0,
aux_qty: 0,
brick_type: null
} }
export default { export default {
name: 'Materialbase', name: 'Materialbase',

30
lms/nladmin-ui/src/views/wms/pdm/workerorder/hl/index.vue

@ -20,11 +20,11 @@
@keyup.enter.native="crud.toQuery" @keyup.enter.native="crud.toQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="BOM编码"> <el-form-item label="物料编码">
<el-input <el-input
v-model="query.material" v-model="query.material"
clearable clearable
placeholder="BOM编码" placeholder="物料编码"
style="width: 200px;" style="width: 200px;"
@keyup.enter.native="crud.toQuery" @keyup.enter.native="crud.toQuery"
/> />
@ -103,7 +103,7 @@
<el-form-item label="生产设备" prop="device_name"> <el-form-item label="生产设备" prop="device_name">
<el-input <el-input
v-model="form.device_name" v-model="form.device_name"
:disabled="crud.status.edit" :disabled="form.order_status > '1'"
style="width: 300px" style="width: 300px"
clearable clearable
@focus="deviceShow=true" @focus="deviceShow=true"
@ -114,13 +114,13 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="BOM编码" prop="material_code"> <el-form-item label="物料编码" prop="material_code">
<el-input <el-input
v-model="form.material_code" v-model="form.material_code"
:disabled="crud.status.edit" :disabled="form.order_status > '1'"
style="width: 300px" style="width: 300px"
clearable clearable
@focus="bomShow=true" @focus="materialShow=true"
@clear="form.material_id=''; form.material_code=''; form.material_name=''" @clear="form.material_id=''; form.material_code=''; form.material_name=''"
/> />
</el-form-item> </el-form-item>
@ -129,7 +129,7 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="计划重量" prop="plan_qty"> <el-form-item label="计划重量" prop="plan_qty">
<el-input v-model="form.plan_qty" :disabled="crud.status.edit" type="number" style="width: 300px"><i slot="suffix" style="font-style:normal;margin-right: 10px;">千克</i></el-input> <el-input v-model="form.plan_qty" :disabled="form.order_status > '1'" type="number" style="width: 300px"><i slot="suffix" style="font-style:normal;margin-right: 10px;">千克</i></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -143,9 +143,9 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="是否料" prop="is_new"> <el-form-item label="是否正品料" prop="is_new">
<el-radio v-model="form.is_new" :disabled="crud.status.edit" label="1"></el-radio> <el-radio v-model="form.is_new" :disabled="form.order_status > '1'" label="1"></el-radio>
<el-radio v-model="form.is_new" :disabled="crud.status.edit" label="0"></el-radio> <el-radio v-model="form.is_new" :disabled="form.order_status > '1'" label="0"></el-radio>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -177,7 +177,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="device_name" label="设备" :min-width="flexWidth('device_name',crud.data,'设备')" /> <el-table-column prop="device_name" label="设备" :min-width="flexWidth('device_name',crud.data,'设备')" />
<el-table-column prop="material_code" label="BOM编码" :min-width="flexWidth('material_code',crud.data,'BOM编码')" /> <el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
<el-table-column prop="plan_qty" label="计划重量" :min-width="flexWidth('plan_qty',crud.data,'计划数量/重量')" /> <el-table-column prop="plan_qty" label="计划重量" :min-width="flexWidth('plan_qty',crud.data,'计划数量/重量')" />
<el-table-column prop="is_urgent" label="是否加急" :min-width="flexWidth('is_urgent',crud.data,'是否加急')"> <el-table-column prop="is_urgent" label="是否加急" :min-width="flexWidth('is_urgent',crud.data,'是否加急')">
<template slot-scope="scope"> <template slot-scope="scope">
@ -209,7 +209,7 @@
<pagination /> <pagination />
</div> </div>
<DeviceDialog :dialog-show.sync="deviceShow" :is-single="true" @tableChanged="tableChanged" /> <DeviceDialog :dialog-show.sync="deviceShow" :is-single="true" @tableChanged="tableChanged" />
<BOMDtl :dialog-show.sync="bomShow" :is-single="true" @setBOMValue="setBOMValue" /> <MaterDtl :dialog-show.sync="materialShow" :is-single="true" @setMaterValue="setMaterValue" />
<ViewDialog ref="child3" /> <ViewDialog ref="child3" />
<!--表单组件--> <!--表单组件-->
<el-dialog <el-dialog
@ -248,7 +248,7 @@ import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination' import pagination from '@crud/Pagination'
import ViewDialog from '@/views/wms/pdm/workerorder/ViewDialog' import ViewDialog from '@/views/wms/pdm/workerorder/ViewDialog'
import DeviceDialog from '@/views/wms/pub/DeviceDialog' import DeviceDialog from '@/views/wms/pub/DeviceDialog'
import BOMDtl from '@/views/wms/pub/BOMDialog.vue' import MaterDtl from '@/views/wms/pub/MaterDialog.vue'
const defaultForm = { const defaultForm = {
workorder_id: null, workorder_id: null,
@ -299,7 +299,7 @@ const defaultForm = {
} }
export default { export default {
name: 'HLWorkorder', name: 'HLWorkorder',
components: { BOMDtl, pagination, crudOperation, rrOperation, udOperation, ViewDialog, DeviceDialog }, components: { MaterDtl, pagination, crudOperation, rrOperation, udOperation, ViewDialog, DeviceDialog },
mixins: [presenter(), header(), form(defaultForm), crud()], mixins: [presenter(), header(), form(defaultForm), crud()],
dicts: ['pdm_workorder_status', 'priority_direction', 'is_used', 'is_or_not', 'material_type', 'vehicle_type', 'workorder_procedure', 'true_or_false', 'wood_vehicle_type'], dicts: ['pdm_workorder_status', 'priority_direction', 'is_used', 'is_or_not', 'material_type', 'vehicle_type', 'workorder_procedure', 'true_or_false', 'wood_vehicle_type'],
cruds() { cruds() {
@ -413,7 +413,7 @@ export default {
this.form.device_name = row.device_name this.form.device_name = row.device_name
this.form.region_code = row.region_code this.form.region_code = row.region_code
}, },
setBOMValue(row) { setMaterValue(row) {
this.form.material_id = row.material_id this.form.material_id = row.material_id
this.form.material_code = row.material_code this.form.material_code = row.material_code
}, },

2
lms/nladmin-ui/src/views/wms/pdm/workerorder/index.vue

@ -230,7 +230,7 @@
<pagination /> <pagination />
</div> </div>
<MaterDtl :dialog-show.sync="materialShow" :is-single="true" @setMaterValue="setMaterValue" /> <MaterDtl :dialog-show.sync="materialShow" :is-single="true" @setMaterValue="setMaterValue" />
<DeviceDialog :dialog-show.sync="deviceShow" :is-single="true" :region-str="'(\'YZ\', \'FJ\')'" @tableChanged="tableChanged" /> <DeviceDialog :dialog-show.sync="deviceShow" :is-single="true" :region-str="'(\'YZ\')'" @tableChanged="tableChanged" />
<ViewDialog ref="child3" /> <ViewDialog ref="child3" />
<!--表单组件--> <!--表单组件-->
<el-dialog <el-dialog

2
lms/nladmin-ui/src/views/wms/pub/BOMDialog.vue

@ -78,7 +78,7 @@ export default {
crudMethod: { ...crudMaterialbase }, crudMethod: { ...crudMaterialbase },
optShow: {}, optShow: {},
query: { query: {
material_type: '2' material_type: '1'
} }
}) })
}, },

24
lms/nladmin-ui/src/views/wms/pub/MaterDialog.vue

@ -23,6 +23,22 @@
@keyup.enter.native="crud.toQuery" @keyup.enter.native="crud.toQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="订单编码">
<el-input
v-model="query.order_code"
clearable
placeholder="订单编码"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="部位">
<el-input
v-model="query.product_grade"
clearable
placeholder="部位"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<rrOperation /> <rrOperation />
</el-form> </el-form>
@ -46,11 +62,9 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" /> <el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
<el-table-column prop="product_code" label="产品编号" :min-width="flexWidth('product_code',crud.data,'产品编号')" /> <el-table-column prop="order_code" label="订单编码" :min-width="flexWidth('order_code',crud.data,'订单编码')" />
<el-table-column prop="a" label="长边长度" :min-width="flexWidth('a',crud.data,'长边长度')" /> <el-table-column prop="product_grade" label="部位" :min-width="flexWidth('product_grade',crud.data,'部位')" />
<el-table-column prop="b" label="短边长度" :min-width="flexWidth('b',crud.data,'短边长度')" /> <el-table-column prop="brick" label="砖型" :min-width="flexWidth('brick',crud.data,'砖型')" />
<el-table-column prop="h" label="梯形高度" :min-width="flexWidth('w',crud.data,'梯形高度')" />
<el-table-column prop="w" label="砖块厚度" :min-width="flexWidth('h',crud.data,'砖块厚度')" />
</el-table> </el-table>
<!--分页组件--> <!--分页组件-->
<pagination /> <pagination />

2
lms/nladmin-ui/src/views/wms/sch/point/index.vue

@ -265,7 +265,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="vehicle_code" label="载具编码" :min-width="flexWidth('vehicle_code',crud.data,'载具编码')" /> <el-table-column prop="vehicle_code" label="载具编码" :min-width="flexWidth('vehicle_code',crud.data,'载具编码')" />
<el-table-column prop="material_code" label="物料编码/BOM编码" :min-width="flexWidth('material_code',crud.data,'物料编码/BOM编码')" /> <el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" show-overflow-tooltip /> <el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" show-overflow-tooltip />
<el-table-column prop="create_name" label="创建人" :min-width="flexWidth('create_name',crud.data,'创建人')" /> <el-table-column prop="create_name" label="创建人" :min-width="flexWidth('create_name',crud.data,'创建人')" />
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" /> <el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" />

Loading…
Cancel
Save