| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; |
| | | import com.example.erp.common.Constants; |
| | | import com.example.erp.entity.pp.DamageDetails; |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.entity.pp.ReportingWork; |
| | | import com.example.erp.entity.pp.ReportingWorkDetail; |
| | | import com.example.erp.entity.sd.Order; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import com.example.erp.entity.sd.OrderProcessDetail; |
| | | import com.example.erp.exception.ServiceException; |
| | | import com.example.erp.mapper.pp.*; |
| | |
| | | import com.example.erp.mapper.sd.OrderMapper; |
| | | import com.example.erp.mapper.sd.OrderProcessDetailMapper; |
| | | import com.example.erp.service.sd.OrderProcessDetailService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | public Map<String, Object> AddSelectLastWorkSv(String processIdStr, String technologyStr, String process) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | //查询流程卡工艺流程 |
| | | String technologicalProcess = reportingWorkMapper.SelectTechnologicalProcess(processIdStr); |
| | | String technologicalProcess = reportingWorkMapper.SelectTechnologicalProcess(processIdStr,technologyStr); |
| | | |
| | | //定义-的位置 |
| | | int index = technologicalProcess.indexOf("-"); |
| | | //获取工艺流程第一个工序 |
| | | String interceptProcess = technologicalProcess.substring(0, index); |
| | | |
| | | |
| | | String[] processList = technologicalProcess.split("->"); |
| | | //获取工艺流程第一个工序 |
| | | String interceptProcess = processList[0]; |
| | | int length = processList.length; |
| | | |
| | | //定义当前工序上下工序 |
| | |
| | | } |
| | | } |
| | | |
| | | //工艺流程 |
| | | map.put("technologicalProcess", technologicalProcess); |
| | | |
| | | //设备下拉框 |
| | | map.put("device", reportingWorkMapper.SelectWorkBasicDeviceMp(process)); |
| | | //班组下拉框 |
| | |
| | | |
| | | //查询本工序报工需要哪几层,上工序是什么 |
| | | String obtainTechnology = reportingWorkMapper.SelectWorkTechnologyMp(processIdStr); |
| | | |
| | | map.put("numberList", flowCardMapper.getGlassNumber(Integer.valueOf(technologyStr),processIdStr)); |
| | | |
| | | //判断本工序是不是第一道工序 |
| | | if (interceptProcess.equals(process)) { |
| | |
| | | damageDetail.setOrderNumber(reportingWorkDetail.getOrderNumber()); |
| | | damageDetail.setProcessId(reportingWork.getProcessId()); |
| | | damageDetail.setTechnologyNumber(reportingWorkDetail.getTechnologyNumber()); |
| | | if (damageDetail.getResponsibleProcess() != reportingWork.getThisProcess()) { |
| | | if (!damageDetail.getResponsibleProcess().equals(reportingWork.getThisProcess())) { |
| | | damageDetail.setQualityInsStatus(1); |
| | | } |
| | | damageDetailsMapper.insert(damageDetail); |
| | | }); |
| | | } |
| | | //查询流程卡工艺流程 |
| | | String technologicalProcess = reportingWorkMapper.SelectTechnologicalProcess(reportingWork.getProcessId()); |
| | | String technologicalProcess = reportingWorkMapper.SelectTechnologicalProcess(reportingWork.getProcessId(), reportingWorkDetail.getTechnologyNumber()); |
| | | |
| | | int index = technologicalProcess.indexOf("-"); |
| | | //获取工艺流程第一个工序 |
| | | String interceptProcess = technologicalProcess.substring(0, index); |
| | | String interceptProcess = ""; |
| | | if (index <0){ |
| | | interceptProcess = technologicalProcess; |
| | | } |
| | | else { |
| | | //获取工艺流程第一个工序 |
| | | interceptProcess = technologicalProcess.substring(0, index); |
| | | } |
| | | |
| | | |
| | | //判断当前工序是否为第一道工序工序,使用流程卡表数量或者小片流程表上工序数量 |
| | | int processNum = 0; |
| | |
| | | .eq(Order::getOrderId, reportingWork.getOrderId()))); |
| | | reportingWork.setFlowCard(new FlowCard()); |
| | | |
| | | |
| | | |
| | | List<Map<String, Object>> reportingWorkDetails = reportingWorkMapper.selectByReportingWorkId(reportingWorkId, reportingWork.getNextProcess()); |
| | | reportingWorkDetails.forEach(reportingWorkDetail -> { |
| | | List<DamageDetails> damageDetailsList = new ArrayList<>(); |
| | |
| | | .eq(DamageDetails::getTechnologyNumber, reportingWorkDetail.get("technology_number")) |
| | | ); |
| | | reportingWorkDetail.put("damageDetails", damageDetailsList); |
| | | }); |
| | | |
| | | }); |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("reportingWork", reportingWork); |
| | | map.put("reportingWorkDetails", reportingWorkDetails); |
| | | map.put("basic", getReportingWorkBase(reportingWork.getProcessId(), reportingWork.getThisProcess())); |
| | | |
| | | //根据报工编号获取层 |
| | | map.put("layer", reportingWorkMapper.selectLayerByReportingWorkId(reportingWorkId)); |
| | | map.put("numberList", flowCardMapper.getGlassNumber(reportingWorkMapper.selectLayerByReportingWorkId(reportingWorkId),reportingWork.getProcessId())); |
| | | |
| | | return map; |
| | | |