Browse Source

开发功能工单自动提交并下发

master
zds 3 months ago
parent
commit
291fec7023
  1. 37
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AutoCommitWorkOrder.java
  2. 4
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AutoCreateWorkOrderTask.java
  3. 5
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/IWorkorderService.java
  4. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/dao/mapper/WorkorderMapper.java
  5. 48
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/dao/mapper/WorkorderMapper.xml
  6. 14
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/impl/WorkorderServiceImpl.java
  7. 4
      lms/nladmin-ui/.env.production

37
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AutoCommitWorkOrder.java

@ -0,0 +1,37 @@
package org.nl.wms.sch.task_manage;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.nl.wms.sch.workorder.service.IWorkorderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Slf4j
@Component
public class AutoCommitWorkOrder {
@Autowired
private IWorkorderService workorderService;
@SneakyThrows
public void run() {
log.info("定时任务AutoCommitWorkOrder开始执行:");
this.doExecute();
log.info("定时任务AutoCommitWorkOrder执行结束:");
}
/**
* 根据工单情况自动提交并生成工单出库任务
*/
private void doExecute() {
//根据工单情况自动提交
workorderService.batchCommitAndCreateOrder();
//并生成工单出库任务
workorderService.batchCreateTask();
}
}

4
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AutoCreateWorkOrderTask.java

@ -1,15 +1,11 @@
package org.nl.wms.sch.task_manage;
import cn.hutool.core.util.ObjectUtil;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.nl.config.SpringContextHolder;
import org.nl.wms.sch.workorder.service.IWorkorderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.lang.reflect.Method;
import java.util.Set;
@Slf4j

5
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/IWorkorderService.java

@ -57,4 +57,9 @@ public interface IWorkorderService extends IService<Workorder> {
* 批量生成工单出库任务
*/
void batchCreateTask();
/**
* 批量提交并生成工单出库任务
*/
void batchCommitAndCreateOrder();
}

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/dao/mapper/WorkorderMapper.java

@ -16,4 +16,6 @@ public interface WorkorderMapper extends BaseMapper<Workorder> {
void batchChange(List<String> pointCodes,String mode,String status);
List<YCLKCDto> getYlOutDetail();
List<YCLKCDto> getYlOutDetailByStatus();
}

48
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/dao/mapper/WorkorderMapper.xml

@ -61,4 +61,52 @@
pointCode
ORDER BY point_code ASC
</select>
<select id="getYlOutDetailByStatus" resultType="org.nl.wms.sch.report.service.dto.YCLKCDto">
SELECT
p.point_code AS pointCode,
p.region_name AS regionName,
p.vehicle_code2 AS subTray,
p.vehicle_code AS motherTray,
ANY_VALUE (t.somtOrderNo) AS somtOrderNo,
ANY_VALUE (t.moname) AS moname,
ANY_VALUE (t.status) AS status,
ANY_VALUE (t.mode) AS mode,
p.update_time AS updateTime,
ANY_VALUE ( m2.siliconGrade ) AS siliconGrade,
ANY_VALUE ( m2.productDescription ) AS productDescription,
ANY_VALUE ( m2.supplierName ) AS supplierName,
ANY_VALUE ( m2.ingotBatch ) AS ingotBatch,
ANY_VALUE ( m2.number ) AS number
FROM
pdm_bd_workorder_two t
LEFT JOIN sch_base_point p ON t.palletSN = p.vehicle_code2
LEFT JOIN (
SELECT
m.PalletSN AS PalletSN,
m.siliconGrade,
m.productDescription,
m.supplierName,
m.ingotBatch,
count( * ) AS number
FROM
sch_base_material m
WHERE
1 = 1
GROUP BY
m.PalletSN,
m.siliconGrade,
m.productDescription,
m.supplierName,
m.ingotBatch
) m2 ON t.palletSN = m2.PalletSN
WHERE
p.vehicle_code2 != ''
AND p.vehicle_code2 IS NOT NULL
AND t.STATUS IN ( '0' )
AND p.region_code IN ( 'YL','YLHC','KJHC' )
GROUP BY
pointCode
ORDER BY point_code ASC
</select>
</mapper>

14
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/impl/WorkorderServiceImpl.java

@ -29,6 +29,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
@Slf4j
@Service
@ -155,4 +156,17 @@ public class WorkorderServiceImpl extends ServiceImpl<WorkorderMapper, Workorder
}
}
}
@Override
//@Transactional(rollbackFor = Exception.class)
public void batchCommitAndCreateOrder(){
//查询可下发的工单
List<YCLKCDto> list = workorderMapper.getYlOutDetailByStatus();
if(list.size()>0){
//载具号集合
List<String> pointCodes = list.stream().map(YCLKCDto::getSubTray).collect(Collectors.toList());
//更新工单状态和回温模式
workorderMapper.batchChange(pointCodes,"0","1");
}
}
}

4
lms/nladmin-ui/.env.production

@ -2,6 +2,6 @@ ENV = 'production'
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
VUE_APP_BASE_API = 'http://47.97.157.227:8010'
VUE_APP_BASE_API = 'http://10.26.138.21:8010'
# 如果接口是 http 形式, wss 需要改为 ws
VUE_APP_WS_API = 'ws://47.97.157.227:8010'
VUE_APP_WS_API = 'ws://10.26.138.21:8010'

Loading…
Cancel
Save