Browse Source

fix: 唛头修改

master
李永德 1 year ago
parent
commit
8f2a9efad1
  1. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/LogMessageConstant.java
  2. 16
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java
  3. 16
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/autotask/AutoSynMaterialInfo.java
  4. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/WmsToMesService.java
  5. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.java
  6. 12
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.xml
  7. 14
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/CusterDo.java
  8. 7
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/impl/WmsToMesServiceImpl.java
  9. 2
      lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml
  10. 6
      lms/nladmin-system/nlsso-server/src/test/java/org/nl/ext/TestDemo.java
  11. 2
      lms/nladmin-ui/src/views/wms/pdm/workerorder/index.vue

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/config/lucene/LogMessageConstant.java

@ -41,6 +41,6 @@ public class LogMessageConstant {
/** 背景颜色:黄色 */
public final static String BACKGROUND_YELLOW = "\u001B[43m";
/** 索引路径 */
public final static String INDEX_DIR = "E:\\lucene\\index";
public final static String INDEX_DIR = "D:\\lucene\\index";
}

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

@ -23,6 +23,7 @@ import org.nl.wms.ext.acs.service.dto.to.acs.ApplyTaskResponse;
import org.nl.wms.ext.acs.service.dto.to.acs.GetPalletizeResponse;
import org.nl.wms.ext.acs.service.dto.to.wms.*;
import org.nl.wms.ext.mes.service.WmsToMesService;
import org.nl.wms.ext.mes.service.dto.CusterDo;
import org.nl.wms.ext.mes.service.dto.CusterVo;
import org.nl.wms.ext.mes.service.dto.MesMudConsumptionDto;
import org.nl.wms.ext.mms.service.WmsToMmsService;
@ -468,7 +469,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
*/
@Override
public ApplyTaskResponse applyLabelling(JSONObject param) {
// 木托盘号(4)##物料编码(12)##数量(2-3)##吨量(单重X数量)##生产日期(11)##客户名称##订单号(12)##产品名称##型号
// 木托盘号(4)##物料编码(12)##数量(2-3)##吨量(单重X数量)##生产日期(2023/11/04)##客户编码##订单号(12)#型号##产品名称##客户名称**
String requestNo = param.getString("requestNo");
ApplyTaskRequest baseRequest = param.toJavaObject(ApplyTaskRequest.class);
if (baseRequest.getVehicle_code() == null) {
@ -491,16 +492,23 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
log.info("包装数据:{}", object);
String custerNo = object.getString("custer_no");
String orderNo = object.getString("order_no");
CusterDo custer;
if (custerNo.matches("\\d+")) {
custer = wmsToMesService.getCusterByNo(custerNo);
} else {
custer = wmsToMesService.getCusterByName(custerNo);
}
// 组合
sb.append(baseRequest.getVehicle_code()).append("##")
.append(baseMaterial.getMaterial_code()).append("##")
.append(groupInfo.getMaterial_qty()).append("##")
.append(multiply).append("##")
.append(DateUtil.format(DateUtil.parse(DateUtil.today()), "yyyy年MM月dd日")).append("##")
.append(custerNo).append("##")
.append(DateUtil.format(DateUtil.parse(DateUtil.today()), "yyyy/MM/dd")).append("##")
.append(custer.getCuster_no()).append("##")
.append(orderNo).append("##")
.append(baseMaterial.getMaterial_spec() + "~" + baseMaterial.getMaterial_model()).append("##")
.append(baseMaterial.getMaterial_name()).append("##")
.append(baseMaterial.getMaterial_model()).append("**");
.append(custer.getCuster_name()).append("**");
return ApplyTaskResponse.responseOk(requestNo, sb.toString());
}

16
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/autotask/AutoSynMaterialInfo.java

@ -3,10 +3,14 @@ package org.nl.wms.ext.mes.autotask;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.nl.wms.ext.mes.service.WmsToMesService;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import java.util.concurrent.TimeUnit;
/**
* @Author: lyd
* @Description: 自动同步物料
@ -18,8 +22,20 @@ import org.springframework.stereotype.Component;
public class AutoSynMaterialInfo {
@Autowired
private WmsToMesService wmsToMesService;
@Autowired
private RedissonClient redissonClient;
@SneakyThrows
public void run() {
RLock lock = redissonClient.getLock(this.getClass().getName());
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
try {
if (tryLock) {
wmsToMesService.synchronizeMaterialInfo();
}
} finally {
if (tryLock) {
lock.unlock();
}
}
}
}

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

@ -116,7 +116,7 @@ public interface WmsToMesService {
* @param custerNo
* @return
*/
CusterVo getCusterByNo(String custerNo);
CusterDo getCusterByNo(String custerNo);
/**
* 分页获取数据
@ -132,4 +132,6 @@ public interface WmsToMesService {
* @return
*/
int getTotal(String materialId);
CusterDo getCusterByName(String custerName);
}

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

@ -63,7 +63,7 @@ public interface MesRequestMapper {
@DS("oracle")
List<CusterVo> getCusterInfo();
@DS("oracle")
CusterVo getCusterByNo(String custerNo);
CusterDo getCusterByNo(String custerNo);
@DS("oracle")
List<MesOrderInfo> selectPageMesOrder(String materialId, int currentPage, int currentSize);
@ -74,4 +74,6 @@ public interface MesRequestMapper {
*/
@DS("oracle")
int getOrderTotalByMaterial(String materialId);
@DS("oracle")
CusterDo getCusterByName(String custerName);
}

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

@ -284,8 +284,10 @@
<select id="getCusterInfo" resultType="org.nl.wms.ext.mes.service.dto.CusterVo">
SELECT CUSTER_NO, CUSTER_NAME FROM "RTMG"."VIEW_CUSTER_LMS"
</select>
<select id="getCusterByNo" resultType="org.nl.wms.ext.mes.service.dto.CusterVo">
SELECT CUSTER_NO, CUSTER_NAME FROM "RTMG"."VIEW_CUSTER_LMS"
<select id="getCusterByNo" resultType="org.nl.wms.ext.mes.service.dto.CusterDo">
SELECT CUSTER_NO AS custer_no,
CUSTER_NAME AS custer_name
FROM "RTMG"."VIEW_CUSTER_LMS"
WHERE CUSTER_NO = #{custerNo}
</select>
<select id="selectPageMesOrder" resultType="org.nl.wms.ext.mes.service.dto.MesOrderInfo">
@ -321,4 +323,10 @@
</if>
</where>
</select>
<select id="getCusterByName" resultType="org.nl.wms.ext.mes.service.dto.CusterDo">
SELECT CUSTER_NO AS custer_no,
CUSTER_NAME AS custer_name
FROM "RTMG"."VIEW_CUSTER_LMS"
WHERE CUSTER_NAME = #{custerName}
</select>
</mapper>

14
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dto/CusterDo.java

@ -0,0 +1,14 @@
package org.nl.wms.ext.mes.service.dto;
import lombok.Data;
/**
* @Author: lyd
* @Description:
* @Date: 2023/11/6
*/
@Data
public class CusterDo {
private String custer_no;
private String custer_name;
}

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

@ -416,7 +416,7 @@ public class WmsToMesServiceImpl implements WmsToMesService {
}
@Override
public CusterVo getCusterByNo(String custerNo) {
public CusterDo getCusterByNo(String custerNo) {
return mesRequestMapper.getCusterByNo(custerNo);
}
@ -430,6 +430,11 @@ public class WmsToMesServiceImpl implements WmsToMesService {
return mesRequestMapper.getOrderTotalByMaterial(materialId);
}
@Override
public CusterDo getCusterByName(String custerName) {
return mesRequestMapper.getCusterByName(custerName);
}
/**
* 转换
*

2
lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml

@ -42,7 +42,7 @@ spring:
freemarker:
check-template-location: false
profiles:
active: prod
active: test
jackson:
time-zone: GMT+8
data:

6
lms/nladmin-system/nlsso-server/src/test/java/org/nl/ext/TestDemo.java

@ -141,6 +141,7 @@ public class TestDemo {
@Test
void testData() {
System.out.println(DateUtil.format(DateUtil.parse(DateUtil.today()), "yyyy年MM月dd日"));
System.out.println(DateUtil.format(DateUtil.parse(DateUtil.today()), "yyyy/MM/dd"));
}
@Test
void testAdd() {
@ -148,4 +149,9 @@ public class TestDemo {
Integer materialQty = 12;
System.out.println(NumberUtil.add(realQty, materialQty));
}
@Test
void testNumberStr() {
System.out.println("1234564".matches("\\d+"));
System.out.println("1234你好564".matches("\\d+"));
}
}

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

@ -242,7 +242,7 @@
v-for="item in custerList"
:key="item.custer_NO"
:label="item.custer_NAME"
:value="item.custer_NAME"
:value="item.custer_NO"
>
<span style="float: left">{{ item.custer_NO }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.custer_NAME }}</span>

Loading…
Cancel
Save