| | |
| | | { |
| | | return toAjax(omProductionOrdeInfoService.deleteOmProductionOrdeInfoByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | | * table列上移下移 |
| | | */ |
| | | @Log(title = "生产工单", businessType = BusinessType.DELETE) |
| | | @GetMapping("/upDownMove") |
| | | public AjaxResult upDownMove(OmProductionOrdeInfo omProductionOrdeInfo) |
| | | { |
| | | return toAjax(omProductionOrdeInfoService.upDownMove(omProductionOrdeInfo)); |
| | | } |
| | | } |
| | |
| | | /** 上线完工标记 */ |
| | | private String onlineCompletionMark; |
| | | |
| | | private Long frontEndId; |
| | | |
| | | /** 需求日期 */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "需求日期", width = 30, dateFormat = "yyyy-MM-dd") |
| | |
| | | /** 预留字段4 */ |
| | | private String spareField4; |
| | | |
| | | public void setId(Long id) |
| | | private Long[] idNums; |
| | | |
| | | private String flag; |
| | | |
| | | public String getFlag() { |
| | | return flag; |
| | | } |
| | | |
| | | public void setFlag(String flag) { |
| | | this.flag = flag; |
| | | } |
| | | |
| | | public Long[] getIdNums() { |
| | | return idNums; |
| | | } |
| | | |
| | | public void setIdNums(Long[] idNums) { |
| | | this.idNums = idNums; |
| | | } |
| | | |
| | | public Long getFrontEndId() { |
| | | return frontEndId; |
| | | } |
| | | |
| | | public void setFrontEndId(Long frontEndId) { |
| | | this.frontEndId = frontEndId; |
| | | } |
| | | |
| | | public void setId(Long id) |
| | | { |
| | | this.id = id; |
| | | } |
| | |
| | | * @return 结果 |
| | | */ |
| | | public int deleteOmProductionOrdeInfoById(Long id); |
| | | |
| | | int upDownMove(OmProductionOrdeInfo omProductionOrdeInfo); |
| | | } |
| | |
| | | package com.jcdm.main.om.productionOrde.service.impl; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import com.jcdm.common.utils.DateUtils; |
| | | import com.jcdm.main.om.productionOrde.domain.OmProductionOrdeInfo; |
| | | import com.jcdm.main.om.productionOrde.mapper.OmProductionOrdeInfoMapper; |
| | |
| | | { |
| | | @Autowired |
| | | private OmProductionOrdeInfoMapper omProductionOrdeInfoMapper; |
| | | |
| | | @Autowired |
| | | private IOmProductionOrdeInfoService omProductionOrdeInfoService; |
| | | |
| | | /** |
| | | * 查询生产工单 |
| | |
| | | { |
| | | return omProductionOrdeInfoMapper.deleteOmProductionOrdeInfoById(id); |
| | | } |
| | | |
| | | @Override |
| | | public int upDownMove(OmProductionOrdeInfo omProductionOrdeInfo) { |
| | | long currentId = omProductionOrdeInfo.getFrontEndId(); |
| | | List<OmProductionOrdeInfo> omProductionOrdeInfos = omProductionOrdeInfoService.selectOmProductionOrdeInfoList(omProductionOrdeInfo); |
| | | List<Long> idList = omProductionOrdeInfos.stream() |
| | | .map(OmProductionOrdeInfo::getId) // 提取id属性 |
| | | .collect(Collectors.toList()); |
| | | int index = idList.indexOf(currentId); |
| | | long moveId = 0L; |
| | | if(omProductionOrdeInfo.getFlag().equals("up")){ |
| | | moveId = idList.get(index - 1); |
| | | }else { |
| | | moveId = idList.get(index + 1); |
| | | } |
| | | OmProductionOrdeInfo currentInfo = new OmProductionOrdeInfo(); |
| | | currentInfo.setId(currentId); |
| | | List<OmProductionOrdeInfo> currentOrdeInfos = omProductionOrdeInfoService.selectOmProductionOrdeInfoList(currentInfo); |
| | | String currentStreamNumber = currentOrdeInfos.get(0).getStreamNumber(); |
| | | OmProductionOrdeInfo moveInfo = new OmProductionOrdeInfo(); |
| | | moveInfo.setId(moveId); |
| | | List<OmProductionOrdeInfo> moveOrdeInfos = omProductionOrdeInfoService.selectOmProductionOrdeInfoList(moveInfo); |
| | | String moveStreamNumber = moveOrdeInfos.get(0).getStreamNumber(); |
| | | moveOrdeInfos.get(0).setStreamNumber(currentStreamNumber); |
| | | omProductionOrdeInfoService.updateOmProductionOrdeInfo(moveOrdeInfos.get(0)); |
| | | currentOrdeInfos.get(0).setStreamNumber(moveStreamNumber); |
| | | omProductionOrdeInfoService.updateOmProductionOrdeInfo(currentOrdeInfos.get(0)); |
| | | return 1; |
| | | } |
| | | } |
| | |
| | | |
| | | <select id="selectOmProductionOrdeInfoList" parameterType="OmProductionOrdeInfo" resultMap="OmProductionOrdeInfoResult"> |
| | | <include refid="selectOmProductionOrdeInfoVo"/> |
| | | <where> |
| | | <where> |
| | | <if test="id != null and id != ''"> and id like concat('%', #{id}, '%')</if> |
| | | <if test="workOrderNo != null and workOrderNo != ''"> and work_order_no like concat('%', #{workOrderNo}, '%')</if> |
| | | <if test="salesOrderCode != null and salesOrderCode != ''"> and sales_order_code like concat('%', #{salesOrderCode}, '%')</if> |
| | | <if test="productCode != null and productCode != ''"> and product_code like concat('%', #{productCode}, '%')</if> |
| | |
| | | <if test="softwareVersionCode != null and softwareVersionCode != ''"> and software_version_code like concat('%', #{softwareVersionCode}, '%')</if> |
| | | <if test="productCompanyCode != null and productCompanyCode != ''"> and product_company_code like concat('%', #{productCompanyCode}, '%')</if> |
| | | </where> |
| | | ORDER BY stream_number DESC |
| | | </select> |
| | | |
| | | <select id="selectOmProductionOrdeInfoById" parameterType="Long" resultMap="OmProductionOrdeInfoResult"> |
| | |
| | | }) |
| | | } |
| | | |
| | | export function upDownMove(query) { |
| | | return request({ |
| | | url: '/om/productionOrde/upDownMove', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // 查询生产工单详细 |
| | | export function getProductionOrde(id) { |
| | | return request({ |
| | |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="el-icon-download" |
| | | icon="el-icon-upload2" |
| | | :disabled="move" |
| | | size="mini" |
| | | @click="moveUp" |
| | |
| | | import { listProductBom } from "@/api/main/bs/ProductBom/ProductBom"; |
| | | import { listTechnologyRoute} from "@/api/main/bs/technologyRoute/technologyRoute"; |
| | | import ItemSelect from "@/components/itemSelect/single.vue"; |
| | | import { listProductionOrde, getProductionOrde, delProductionOrde, addProductionOrde, updateProductionOrde } from "@/api/main/om/productionOrde/productionOrde"; |
| | | import { upDownMove, listProductionOrde, getProductionOrde, delProductionOrde, addProductionOrde, updateProductionOrde } from "@/api/main/om/productionOrde/productionOrde"; |
| | | |
| | | export default { |
| | | name: "ProductionOrde", |
| | |
| | | marketAreaCode: null, |
| | | softwareVersionCode: null, |
| | | productCompanyCode: null, |
| | | frontEndId: 0, |
| | | idNums: null, |
| | | flag: null, |
| | | |
| | | }, |
| | | // 表单参数 |
| | | form: {}, |
| | |
| | | this.initWorkshop(); |
| | | }, |
| | | methods: { |
| | | moveUp(){ |
| | | this.$modal.msgSuccess("上移"); |
| | | moveUp(row){ |
| | | const ids = row.id || this.ids |
| | | let str = JSON.stringify(ids); |
| | | let num = BigInt(str.replace(/[\[\]]/g, '')); |
| | | this.queryParams.frontEndId = num |
| | | this.queryParams.idNums = ids |
| | | this.queryParams.flag = 'up' |
| | | upDownMove(this.queryParams).then(response => { |
| | | this.getList(); |
| | | }); |
| | | }, |
| | | down(selection){ |
| | | this.$modal.msgSuccess("下移"); |
| | | down(row){ |
| | | const ids = row.id || this.ids |
| | | let str = JSON.stringify(ids); |
| | | let num = BigInt(str.replace(/[\[\]]/g, '')); |
| | | this.queryParams.frontEndId = num |
| | | this.queryParams.idNums = ids |
| | | this.queryParams.flag = 'down' |
| | | upDownMove(this.queryParams).then(response => { |
| | | this.getList(); |
| | | }); |
| | | }, |
| | | initWorkshop(){ |
| | | listWorkshop(this.queryParams).then(response => { |
| | |
| | | // if (selection.length === 1) { |
| | | // this.move = false; |
| | | // } |
| | | |
| | | if (selection.length > 0) { |
| | | this.selectedRowIndex = this.productionOrdeList.indexOf(rows[0]); // 获取选中行的索引 |
| | | } else { |
| | | this.selectedRowIndex = -1; // 如果没有选中行,则将索引设为-1 |
| | | } |
| | | |
| | | }, |
| | | /** 新增按钮操作 */ |