| | |
| | | this.reportingWorkMapper = reportingWorkMapper; |
| | | } |
| | | |
| | | //将层数字符串用逗号隔开 |
| | | public static String splitTechNumbers(String input) { |
| | | if (input == null || input.isEmpty()) { |
| | | return ""; |
| | | } |
| | | |
| | | List<String> result = new ArrayList<>(); |
| | | for (int i = 0; i < input.length(); i++) { |
| | | // 特殊处理 "10" |
| | | if (input.charAt(i) == '1' && i + 1 < input.length() && input.charAt(i + 1) == '0') { |
| | | result.add("10"); |
| | | i++; // 跳过下一个字符 |
| | | } else { |
| | | result.add(String.valueOf(input.charAt(i))); |
| | | } |
| | | } |
| | | |
| | | return String.join(",", result); |
| | | } |
| | | //流程卡管理查询 |
| | | public Map<String, Object> selectProcessCard(Integer pageNum, Integer pageSize,List<String> selectDate, FlowCard flowCard) { |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | |
| | | if (compound == null |
| | | || "null".equals(compound) |
| | | || compound.trim().isEmpty()){ |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailList(flowCard.getProcessId(), flowCard.getTechnologyNumber(), flowCard.getProcess(),flashback,landingSequence); |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailList(flowCard.getProcessId(), splitTechNumbers(flowCard.getTechnologyNumber()), flowCard.getProcess(),flashback,landingSequence); |
| | | itemmap.put("detailList", detailList); |
| | | }else {//有需要同架的层 |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailCompoundList(flowCard.getProcessId(), flowCard.getTechnologyNumber(), flowCard.getProcess(),flashback,compound,landingSequence); |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailCompoundList(flowCard.getProcessId(), splitTechNumbers(flowCard.getTechnologyNumber()), flowCard.getProcess(),flashback,splitTechNumbers(compound),landingSequence); |
| | | itemmap.put("detailList", detailList); |
| | | } |
| | | } else { |
| | |
| | | if (compound == null |
| | | || "null".equals(compound) |
| | | || compound.trim().isEmpty()){ |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailListLike(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()), flowCard.getProcess(),flashback,landingSequence); |
| | | |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailListLike(flowCard.getProcessId(), splitTechNumbers(flowCard.getTechnologyNumber()), flowCard.getProcess(),flashback,landingSequence); |
| | | itemmap.put("detailList", detailList); |
| | | }else {//有需要同架的层 |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailListLikeCompound(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()), flowCard.getProcess(),flashback,compound,landingSequence); |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailListLikeCompound(flowCard.getProcessId(), splitTechNumbers(flowCard.getTechnologyNumber()), flowCard.getProcess(),flashback,splitTechNumbers(compound),landingSequence); |
| | | itemmap.put("detailList", detailList); |
| | | } |
| | | } |
| | |
| | | this.reportingWorkTransferMapper = reportingWorkTransferMapper; |
| | | }*/ |
| | | |
| | | //将层数字符串用逗号隔开 |
| | | public static String splitTechNumbers(String input) { |
| | | if (input == null || input.isEmpty()) { |
| | | return ""; |
| | | } |
| | | |
| | | List<String> result = new ArrayList<>(); |
| | | for (int i = 0; i < input.length(); i++) { |
| | | // 特殊处理 "10" |
| | | if (input.charAt(i) == '1' && i + 1 < input.length() && input.charAt(i + 1) == '0') { |
| | | result.add("10"); |
| | | i++; // 跳过下一个字符 |
| | | } else { |
| | | result.add(String.valueOf(input.charAt(i))); |
| | | } |
| | | } |
| | | |
| | | return String.join(",", result); |
| | | } |
| | | |
| | | public Map<String, Object> AddSelectLastWorkSv(String processIdStr, String technologyStr, String process, String reportType) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | //获取报工工序是否为复合工程 |
| | | String laminating = reportingWorkMapper.getProcessLaminating(process); |
| | | //查询流程卡工艺流程 |
| | | String technologicalProcess = reportingWorkMapper.SelectTechnologicalProcess(processIdStr,technologyStr); |
| | | String technologicalProcess = reportingWorkMapper.SelectTechnologicalProcess(processIdStr,splitTechNumbers(technologyStr)); |
| | | |
| | | if (technologicalProcess!=null || !technologicalProcess.equals("")){ |
| | | String[] processList = technologicalProcess.split("->"); |
| | |
| | | nextProcess = processList[i + 1]; |
| | | } |
| | | //查询当前工序的表头数据 |
| | | map.put("data", reportingWorkMapper.AddSelectLastWorkMp(processIdStr, technologyStr, previousProcess, nextProcess, process,reportType)); |
| | | map.put("data", reportingWorkMapper.AddSelectLastWorkMp(processIdStr, splitTechNumbers(technologyStr), previousProcess, nextProcess, process,reportType)); |
| | | map.put("thisProcess", processList); |
| | | break; |
| | | } |
| | |
| | | //查询本工序报工需要哪几层,上工序是什么 |
| | | String obtainTechnology = reportingWorkMapper.SelectWorkTechnologyMp(processIdStr); |
| | | |
| | | map.put("numberList", flowCardMapper.getGlassNumber(technologyStr,processIdStr)); |
| | | map.put("numberList", flowCardMapper.getGlassNumber(splitTechNumbers(technologyStr),processIdStr)); |
| | | |
| | | //判断本工序是不是第一道工序 |
| | | if (interceptProcess.equals(process)) { |
| | | //是第一道工序,查询流程卡数据 |
| | | map.put("Detail", reportingWorkMapper.SelectTechnologicalNumMp(processIdStr, technologyStr, process,reportType)); |
| | | map.put("Detail", reportingWorkMapper.SelectTechnologicalNumMp(processIdStr, splitTechNumbers(technologyStr), process,reportType)); |
| | | } else { |
| | | ReportingWork retrievedData = (ReportingWork) map.get("data"); |
| | | if (retrievedData!=null){ |
| | |
| | | //根据审核状态查询未审核数据 |
| | | // if (reviewedState==1){//已审核 |
| | | //不是第一道工序,查询报工数据 |
| | | List<Map<String,String>> details = reportingWorkMapper.SelectReworlDetailMp(processIdStr, technologyStr, process,previousProcess,laminating); |
| | | List<Map<String,String>> details = reportingWorkMapper.SelectReworlDetailMp(processIdStr, splitTechNumbers(technologyStr), process,previousProcess,laminating); |
| | | if(process.equals("中空")){ |
| | | //获取该流程卡订单号 |
| | | String orderId = reportingWorkMapper.selectOrderid(processIdStr); |
| | |
| | | fcs.technology_number = fc.technology_number |
| | | and fcs.process = #{process} |
| | | where fc.process_id = #{processId} |
| | | and position(fc.technology_number in #{technologyNumber}) |
| | | and FIND_IN_SET(fc.technology_number , #{technologyNumber}) |
| | | group by fc.process_id, fc.order_number |
| | | <choose> |
| | | <!-- 当 landingSequence != 1 且 flashback != 1 时,按 landing_sequence 倒序 --> |
| | |
| | | from sd.order_detail as od |
| | | left join flow_card as fc on od.order_id = fc.order_id and od.order_number = fc.order_number |
| | | where fc.process_id = #{processId} |
| | | and POSITION(fc.technology_number in #{technologyNumber}) |
| | | and FIND_IN_SET(fc.technology_number , #{technologyNumber}) |
| | | GROUP BY other_columns |
| | | order by IF(fc.sort != NULL or fc.sort != '', fc.sort, fc.order_number) |
| | | </select> |
| | |
| | | fcs.technology_number = fc.technology_number |
| | | and fcs.process = #{process} |
| | | where fc.process_id = #{processId} |
| | | and position(fc.technology_number in #{technologyNumber}) |
| | | and FIND_IN_SET(fc.technology_number , #{technologyNumber}) |
| | | group by fc.process_id, fc.order_number, fc.technology_number |
| | | <choose> |
| | | <when test="landingSequence != 1 and flashback != 1"> |
| | |
| | | fcs.technology_number = fc.technology_number |
| | | and fcs.process = #{process} |
| | | where fc.process_id = #{processId} |
| | | and position(fc.technology_number in #{compound}) |
| | | and |
| | | FIND_IN_SET(fc.technology_number , #{compound}) |
| | | group by fc.process_id, fc.order_number |
| | | <choose> |
| | | <when test="landingSequence != 1 and flashback != 1"> |
| | |
| | | fcs.technology_number = fc.technology_number |
| | | and fcs.process = #{process} |
| | | where fc.process_id = #{processId} |
| | | and position(fc.technology_number in #{compound}) |
| | | and FIND_IN_SET(fc.technology_number , #{compound}) |
| | | group by fc.process_id, fc.order_number |
| | | <choose> |
| | | <when test="landingSequence != 1 and flashback != 1"> |
| | |
| | | from reporting_work as a |
| | | left join reporting_work_detail as b on a.reporting_work_id = b.reporting_work_id |
| | | where this_process=#{previousProcess} and reviewed_state=0 and process_id=#{processIdStr} |
| | | and POSITION(b.technology_number in #{technologyStr}) |
| | | and FIND_IN_SET(b.technology_number , #{technologyStr}) |
| | | ) as rw |
| | | on rw.process_id = fc.process_id |
| | | left join reporting_work_detail as rwd on rw.reporting_work_id = rwd.reporting_work_id and rwd.technology_number=fc.technology_number |
| | |
| | | left join flow_card as fc on fc.order_id=o.order_id and fc.order_number=ogd.order_number and fc.technology_number=ogd.technology_number |
| | | where fc.process_id = #{processIdStr} |
| | | and o.create_order>0 |
| | | and POSITION(fc.technology_number in #{technologyStr}) |
| | | and FIND_IN_SET(fc.technology_number , #{technologyStr}) |
| | | limit 1),'') as process |
| | | |
| | | </select> |
| | |
| | | where |
| | | reporting_work.this_process = #{process} |
| | | and a.process_id=#{processIdStr} |
| | | and POSITION(a.technology_number in #{technologyStr}) |
| | | and FIND_IN_SET(a.technology_number , #{technologyStr}) |
| | | and a.review_status = 1 |
| | | group by a.process_id,a.order_sort,a.technology_number |
| | | ) as patch |
| | |
| | | |
| | | WHERE |
| | | fc.process_id = #{processIdStr} |
| | | AND POSITION(fc.technology_number in #{technologyStr}) |
| | | AND FIND_IN_SET(fc.technology_number , #{technologyStr}) |
| | | AND odpd.process = #{process} |
| | | and if(#{reportType}=1,o.order_type!='样品订单',o.order_id!='') |
| | | and o.create_order>0 and fc.quantity - ifnull(fc.termination_quantity,0)>0 |
| | |
| | | from sd.order_glass_detail |
| | | where order_id = ogd.order_id |
| | | and order_number = ogd.order_number |
| | | and POSITION(technology_number in #{technologyStr}) |
| | | and FIND_IN_SET(technology_number , #{technologyStr}) |
| | | limit 1) |
| | | </if> |
| | | |
| | |
| | | left join reporting_work_detail as b on a.reporting_work_id = b.reporting_work_id |
| | | where this_process=#{previousProcess} and process_id= #{processIdStr} and a.reviewed_state>=0 |
| | | <if test="laminating == ''"> |
| | | AND POSITION(b.technology_number in #{technologyStr}) |
| | | AND FIND_IN_SET(b.technology_number , #{technologyStr}) |
| | | </if> |
| | | GROUP BY b.order_number,b.technology_number |
| | | ) as rws |
| | |
| | | |
| | | AND odpd.process = #{process} |
| | | <if test="laminating == ''"> |
| | | AND POSITION(fc.technology_number in #{technologyStr}) |
| | | AND FIND_IN_SET(fc.technology_number , #{technologyStr}) |
| | | </if> |
| | | order by fc.order_number |
| | | </select> |