diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/AppRun.java b/mes/hd/nladmin-system/src/main/java/org/nl/AppRun.java index 807d4d0f..a7e7e76f 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/AppRun.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/AppRun.java @@ -4,7 +4,8 @@ import cn.dev33.satoken.annotation.SaIgnore; import com.alicp.jetcache.Cache; import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation; import com.alicp.jetcache.anno.config.EnableMethodCache; - + +import lombok.extern.slf4j.Slf4j; import org.mybatis.spring.annotation.MapperScan; import org.nl.modules.wql.util.SpringContextHolder; import org.springframework.boot.CommandLineRunner; @@ -29,7 +30,7 @@ import org.springframework.web.bind.annotation.RestController; */ @EnableAsync @RestController - + @SpringBootApplication(exclude = { org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class }) @@ -40,6 +41,7 @@ import org.springframework.web.bind.annotation.RestController; @EnableMethodCache(basePackages = "org.nl") @EnableCreateCacheAnnotation @MapperScan("org.nl.**.mapper") +@Slf4j public class AppRun implements CommandLineRunner { private Cache userCache; @@ -53,7 +55,7 @@ public class AppRun implements CommandLineRunner { @Override public void run(String... args) throws Exception { - System.out.println(111); + log.warn("项目启动完成"); } @Bean diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/modules/logging/aspect/LogAspect.java b/mes/hd/nladmin-system/src/main/java/org/nl/modules/logging/aspect/LogAspect.java index 505b8a32..52148db9 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/modules/logging/aspect/LogAspect.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/modules/logging/aspect/LogAspect.java @@ -85,11 +85,11 @@ public class LogAspect { try { log.info("[--request--][请求接口:{}][请求参数:{}]",url,params); result = joinPoint.proceed(); - //是否把日志存到日志表 - if (logInfo.isAddLogTable()) { - Log log = new Log("INFO", System.currentTimeMillis() - comming); - logService.save(getUsername(), StringUtils.getBrowser(request), requestIp, joinPoint, log); - } +// //是否把日志存到日志表 +// if (logInfo.isAddLogTable()) { +// Log log = new Log("INFO", System.currentTimeMillis() - comming); +// logService.save(getUsername(), StringUtils.getBrowser(request), requestIp, joinPoint, log); +// } }catch (Exception ex){ StringBuffer errorStack = new StringBuffer(); errorStack.append("
【异常堆栈:"); diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/modules/wql/util/WqlUtil.java b/mes/hd/nladmin-system/src/main/java/org/nl/modules/wql/util/WqlUtil.java index 289ba676..91b80d2f 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/modules/wql/util/WqlUtil.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/modules/wql/util/WqlUtil.java @@ -173,6 +173,7 @@ public class WqlUtil{ str = str.substring(str.indexOf(beginStr) + 1, str.indexOf(endStr)); } catch(Exception arg3) { + arg3.printStackTrace(); } return str; } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/ext_manage/acs/service/impl/AcsToWmsServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/ext_manage/acs/service/impl/AcsToWmsServiceImpl.java index 2df046b2..ec9db7d4 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/ext_manage/acs/service/impl/AcsToWmsServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/ext_manage/acs/service/impl/AcsToWmsServiceImpl.java @@ -358,31 +358,41 @@ public class AcsToWmsServiceImpl implements AcsToWmsService{ @Override @Async public void feedOrderRealQty(JSONObject param) { + String today = DateUtil.today().replace("-", ""); if (CollectionUtils.isEmpty(param)){ return; } - Iterator iterator = param.keySet().iterator(); - Map map = workorderService.list(new QueryWrapper() - .in("workorder_code", param.keySet())) - .stream().collect(HashMap::new, (k, v) -> k.put(v.getWorkorder_code(), v), HashMap::putAll); - Date now = new Date(); - BigDecimal divide = new BigDecimal(0); - while (iterator.hasNext()){ - String workorderCode = iterator.next(); - BigDecimal dq_real_qty = param.getBigDecimal(workorderCode); - PdmProduceWorkorder workorder = map.get(workorderCode); - if(workorder == null){ - continue; + Iterator check = param.keySet().iterator(); + while (check.hasNext()){ + String key = check.next(); + if (!key.contains(today)){ + check.remove(); } - BigDecimal subtract = dq_real_qty.subtract(workorder.getDq_real_qty()); - if (workorder.getUpdate_time() !=null){ - divide = subtract.divide(new BigDecimal(DateUtil.between(workorder.getUpdate_time(), now, DateUnit.SECOND)), 3, RoundingMode.HALF_UP); + } + if (!CollectionUtils.isEmpty(param)){ + Iterator iterator = param.keySet().iterator(); + Map map = workorderService.list(new QueryWrapper() + .in("workorder_code", param.keySet())) + .stream().collect(HashMap::new, (k, v) -> k.put(v.getWorkorder_code(), v), HashMap::putAll); + Date now = new Date(); + BigDecimal divide = new BigDecimal(0); + while (iterator.hasNext()){ + String workorderCode = iterator.next(); + BigDecimal dq_real_qty = param.getBigDecimal(workorderCode); + PdmProduceWorkorder workorder = map.get(workorderCode); + if(workorder == null){ + continue; + } + BigDecimal subtract = dq_real_qty.subtract(workorder.getDq_real_qty()); + if (workorder.getUpdate_time() !=null){ + divide = subtract.divide(new BigDecimal(DateUtil.between(workorder.getUpdate_time(), now, DateUnit.SECOND)), 3, RoundingMode.HALF_UP); + } + workorderService.update(new UpdateWrapper() + .set("dq_real_qty",dq_real_qty) + .set("update_time",DateUtil.now()) + .set("slope",divide) + .eq("workorder_code",workorderCode)); } - workorderService.update(new UpdateWrapper() - .set("dq_real_qty",dq_real_qty) - .set("update_time",DateUtil.now()) - .set("slope",divide) - .eq("workorder_code",workorderCode)); } } diff --git a/mes/hd/nladmin-system/src/main/resources/config/application-dev3.yml b/mes/hd/nladmin-system/src/main/resources/config/application-dev3.yml index 0a1a55b2..29c74a9d 100644 --- a/mes/hd/nladmin-system/src/main/resources/config/application-dev3.yml +++ b/mes/hd/nladmin-system/src/main/resources/config/application-dev3.yml @@ -1,5 +1,8 @@ server: port: 8011 + tomcat: + max-threads: 300 + min-spare-threads: 30 #配置数据源 spring: datasource: diff --git a/mes/hd/nladmin-system/src/main/resources/config/application-prod.yml b/mes/hd/nladmin-system/src/main/resources/config/application-prod.yml index 06e5f7fa..b4284c9f 100644 --- a/mes/hd/nladmin-system/src/main/resources/config/application-prod.yml +++ b/mes/hd/nladmin-system/src/main/resources/config/application-prod.yml @@ -1,5 +1,8 @@ server: port: 8011 + tomcat: + max-threads: 300 + min-spare-threads: 30 #配置数据源 spring: datasource: diff --git a/mes/hd/nladmin-system/src/main/resources/config/application.yml b/mes/hd/nladmin-system/src/main/resources/config/application.yml index aaf699a8..3cb17f3c 100644 --- a/mes/hd/nladmin-system/src/main/resources/config/application.yml +++ b/mes/hd/nladmin-system/src/main/resources/config/application.yml @@ -2,7 +2,7 @@ spring: freemarker: check-template-location: false profiles: - active: dev3 + active: prod jackson: time-zone: GMT+8 data: diff --git a/mes/hd/nladmin-system/src/main/resources/logback-spring.xml b/mes/hd/nladmin-system/src/main/resources/logback-spring.xml index 463071cd..c7bc5d88 100644 --- a/mes/hd/nladmin-system/src/main/resources/logback-spring.xml +++ b/mes/hd/nladmin-system/src/main/resources/logback-spring.xml @@ -79,9 +79,8 @@ - - - + + @@ -89,6 +88,9 @@ + + + @@ -111,8 +113,10 @@ - + + +