change - 车间生产根据planId查看SOP

master
yinq 1 month ago
parent 2c2743ef45
commit 122ca93cd2

@ -340,6 +340,7 @@ public class MesProductPlanController extends BaseController {
/**
*
* @param attachType
* @param attachId
* @return
*/
@ -347,4 +348,15 @@ public class MesProductPlanController extends BaseController {
public AjaxResult checkMesProductPlanAttachInfo(@PathVariable("attachType") String attachType, @PathVariable("attachId") String attachId) {
return success(mesProductPlanService.checkMesProductPlanAttachInfo(attachType, attachId));
}
/**
* planIdSOPList
* @param attachType
* @param planId
* @return
*/
@GetMapping(value = "/getDispatchAttachByPlanIdList/{attachType}/{planId}")
public AjaxResult getDispatchAttachByPlanIdList(@PathVariable("attachType") String attachType, @PathVariable("planId") Long planId) {
return success(mesProductPlanService.getDispatchAttachByPlanIdList(attachType, planId));
}
}

@ -202,4 +202,12 @@ public interface IMesProductPlanService
* @return
*/
String checkMesProductPlanAttachInfo(String attachType, String attachId);
/**
* planIdSOPList
* @param attachType
* @param planId
* @return
*/
public List<MesBaseAttachInfo> getDispatchAttachByPlanIdList(String attachType, Long planId);
}

@ -848,6 +848,48 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
return result;
}
/**
* planIdSOPList
* @param attachType
* @param planId
* @return
*/
@Override
public List<MesBaseAttachInfo> getDispatchAttachByPlanIdList(String attachType, Long planId) {
MesProductPlan queryProductPlan = new MesProductPlan();
queryProductPlan.setPlanId(planId);
List<MesProductPlan> mesProductPlans = mesProductPlanMapper.selectOnlyMesProductPlans(queryProductPlan);
if (mesProductPlans != null && !mesProductPlans.isEmpty()) {
MesProductPlan mesProductPlan = mesProductPlans.get(0);
try {
if (attachType.equals(MesConstants.MES_ATTACH_TYPE_DRAWING)) {
if (StringUtils.isEmpty(mesProductPlan.getAttachId())) {
return new ArrayList<>();
}
Long[] attachIds = Arrays.stream(mesProductPlan.getAttachId().split(","))
.map(String::trim)
.map(Long::parseLong)
.toArray(Long[]::new);
return mesBaseAttachInfoService.selectMesBaseAttachInfoByAttachIds(attachIds);
} else if (attachType.equals(MesConstants.MES_ATTACH_TYPE_SOP)) {
if (StringUtils.isEmpty(mesProductPlan.getSopId())) {
return new ArrayList<>();
}
Long[] sopIds = Arrays.stream(mesProductPlan.getSopId().split(","))
.map(String::trim)
.map(Long::parseLong)
.toArray(Long[]::new);
return mesBaseAttachInfoService.selectMesBaseAttachInfoByAttachIds(sopIds);
} else {
return new ArrayList<>();
}
} catch (Exception e) {
return new ArrayList<>();
}
}
return new ArrayList<>();
}
// public String executeAssignTaskResultTask() {
// ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();

@ -509,6 +509,7 @@
a.is_flag
from mes_product_plan a
<where>
<if test="planId != null ">and a.plan_id = #{planId}</if>
<if test="dispatchCode != null and dispatchCode != ''">and a.dispatch_code = #{dispatchCode}</if>
<if test="processId != null ">and a.process_id = #{processId}</if>
<if test="userId != null ">and a.user_id = #{userId}</if>

@ -170,3 +170,11 @@ export function checkMesProductPlanAttachInfo(attachType, attachIds) {
method: 'get'
})
}
// 根据planId获取生产派工SOP附件List列表
export function getDispatchAttachByPlanIdList(attachType, planId) {
return request({
url: '/mes/productplan/getDispatchAttachByPlanIdList/' + attachType + '/' + planId,
method: 'get'
})
}

@ -639,7 +639,7 @@ import applyRawReturn from '@//views/board/common/applyRawReturn.vue';
import WorkshopNotice from "@/components/workshopNotice/index.vue";
import {noticeData} from "@/utils/notice"
import ViewFile from "@/components/viewFile/index.vue";
import {getDispatchSOPAttachList} from "@/api/mes/productplan";
import {getDispatchAttachByPlanIdList, } from "@/api/mes/productplan";
import {monitorSerialData} from "@/utils/serial";
import saleOrderRelates from "@/views/board/common/saleOrderRelates.vue";
@ -1855,7 +1855,7 @@ export default {
/** SOP预览*/
handleViewSOP(e) {
this.fileListData = [];
getDispatchSOPAttachList(e.dispatchCode, e.processId).then(res => {
getDispatchAttachByPlanIdList("2", e.planId).then(res => {
let attachList = res.data;
let thisFileList = [];
attachList.forEach(e => {

@ -513,7 +513,7 @@ import applyRawOutstock from "@/views/board/common/applyRawOutstock.vue";
import applyRawReturn from '@//views/board/common/applyRawReturn.vue';
import {getNowDateTime} from "@/utils/ruoyi";
import ViewFile from "@/components/viewFile/index.vue";
import {getDispatchSOPAttachList} from "@/api/mes/productplan";
import {getDispatchAttachByPlanIdList, } from "@/api/mes/productplan";
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default {
@ -1102,7 +1102,7 @@ export default {
/** SOP预览*/
handleViewSOP(e){
this.fileListData = [];
getDispatchSOPAttachList(e.dispatchCode, e.processId).then(res => {
getDispatchAttachByPlanIdList("2", e.planId).then(res => {
let attachList = res.data;
let thisFileList = [];
attachList.forEach(e => {

@ -494,7 +494,7 @@ import {getNowDateTime} from "@/utils/ruoyi";
import WorkshopNotice from "@/components/workshopNotice/index.vue";
import {noticeData} from "@/utils/notice"
import ViewFile from "@/components/viewFile/index.vue";
import {getDispatchSOPAttachList} from "@/api/mes/productplan";
import {getDispatchAttachByPlanIdList, } from "@/api/mes/productplan";
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default {
@ -1270,7 +1270,7 @@ export default {
/** SOP预览*/
handleViewSOP(e){
this.fileListData = [];
getDispatchSOPAttachList(e.dispatchCode, e.processId).then(res => {
getDispatchAttachByPlanIdList("2", e.planId).then(res => {
let attachList = res.data;
let thisFileList = [];
attachList.forEach(e => {

@ -374,7 +374,7 @@ import {addWmslocation, updateWmslocation} from "@/api/wms/wmslocation";
import WorkshopNotice from "@/components/workshopNotice/index.vue";
import {noticeData} from "@/utils/notice"
import ViewFile from "@/components/viewFile/index.vue";
import {getDispatchSOPAttachList} from "@/api/mes/productplan";
import {getDispatchAttachByPlanIdList, } from "@/api/mes/productplan";
const setState = (e) => {
if (e === '1') {
@ -1335,7 +1335,7 @@ export default {
/** SOP预览*/
handleViewSOP(){
this.fileListData = [];
getDispatchSOPAttachList(this.selectedRows.dispatchCode, this.selectedRows.processId).then(res => {
getDispatchAttachByPlanIdList("2", this.selectedRows.planId).then(res => {
let attachList = res.data;
let thisFileList = [];
attachList.forEach(e => {

@ -383,7 +383,7 @@ import {
import WorkshopNotice from "@/components/workshopNotice/index.vue";
import {noticeData} from "@/utils/notice"
import ViewFile from "@/components/viewFile/index.vue";
import {getDispatchSOPAttachList} from "@/api/mes/productplan";
import {getDispatchAttachByPlanIdList, } from "@/api/mes/productplan";
import applyRawOutstock from "@/views/board/common/applyRawOutstock.vue";
import PrintPage from "@/views/board/barcode/workshopBarcode.vue";
@ -1044,7 +1044,7 @@ export default {
/** SOP预览*/
handleViewSOP(e) {
this.fileListData = [];
getDispatchSOPAttachList(e.dispatchCode, e.processId).then(res => {
getDispatchAttachByPlanIdList("2", e.planId).then(res => {
let attachList = res.data;
let thisFileList = [];
attachList.forEach(e => {

Loading…
Cancel
Save