From 3d97f80caafeccac05e3c1c3d3f45e83ee966055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=B8=E7=86=9F=E5=90=B4=E5=BD=A6=E7=A5=96?= Date: Sun, 21 Sep 2025 18:44:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/NewIssureController.java | 153 ++++++++++++++++-- .../SOIssueNotifyOrderMaterialListData.java | 2 + .../notify/mapper/NewIssureMapper.java | 41 ++++- .../notify/service/NewIssureService.java | 77 ++++++++- .../service/impl/NewIssureServiceImpl.java | 138 ++++++++++++++++ .../mapper/notify/IssureNotifyMapper.xml | 17 +- .../mapper/notify/NewIssureMapper.xml | 80 +++++++++ 7 files changed, 478 insertions(+), 30 deletions(-) diff --git a/src/main/java/com/gaotao/modules/notify/controller/NewIssureController.java b/src/main/java/com/gaotao/modules/notify/controller/NewIssureController.java index fb48de3..2160b9a 100644 --- a/src/main/java/com/gaotao/modules/notify/controller/NewIssureController.java +++ b/src/main/java/com/gaotao/modules/notify/controller/NewIssureController.java @@ -1,12 +1,11 @@ package com.gaotao.modules.notify.controller; +import com.gaotao.common.utils.PageUtils; import com.gaotao.common.utils.R; import com.gaotao.modules.api.entity.IfsShopOrder; import com.gaotao.modules.api.service.IfsApiService; import com.gaotao.modules.base.entity.SOScheduledRoutingData; -import com.gaotao.modules.notify.entity.NotifyExcelData; -import com.gaotao.modules.notify.entity.SOIssueNotifyOrderMaterialList; -import com.gaotao.modules.notify.entity.SOIssueNotifyOrderMaterialListData; +import com.gaotao.modules.notify.entity.*; import com.gaotao.modules.notify.entity.vo.ShopOrderMaterialVo; import com.gaotao.modules.notify.service.NewIssureService; import org.springframework.beans.factory.annotation.Autowired; @@ -41,26 +40,150 @@ public class NewIssureController { } /** - * @Description Excel文件上传并解析 + * @Description Excel文件上传并解析 - AI制作 * @Title uploadNotifyExcel * @param file Excel文件 - * @author system - * @date 2024/12/19 + * @param site 工厂编码 + * @param notifyNo 申请单号 * @return R - * @throws Exception + * @author AI制作 + * @date 2024/12/19 */ @PostMapping(value="/uploadNotifyExcel") - @ResponseBody - public R uploadNotifyExcel(@RequestParam("file") MultipartFile file, - @RequestParam("site") String site, - @RequestParam("notifyNo") String notifyNo) throws Exception { + public R uploadNotifyExcel(@RequestParam("file") MultipartFile file, + @RequestParam("site") String site, + @RequestParam("notifyNo") String notifyNo) { try { newIssureService.uploadNotifyExcel(file, site, notifyNo); - return R.ok("Excel文件上传并处理成功"); + return R.ok(); + } catch (Exception e) { + return R.error("Excel导入失败: " + e.getMessage()); + } + } + + /** + * @Description 查询申请单主表 - AI制作 + * @Title searchNotifyHeaderNew + * @param data 查询条件 + * @return R + * @author AI制作 + * @date 2024/12/19 + */ + @PostMapping(value="/searchNotifyHeaderNew") + public R searchNotifyHeaderNew(@RequestBody SOIssueNotifyHeaderData data) { + try { + PageUtils page = newIssureService.searchNotifyHeaderNew(data); + return R.ok().put("page", page); + } catch (Exception e) { + return R.error("查询申请单主表失败: " + e.getMessage()); + } + } + + /** + * @Description 查询申请单明细 - AI制作 + * @Title searchNotifyOrderListNew + * @param data 查询条件 + * @return R + * @author AI制作 + * @date 2024/12/19 + */ + @PostMapping(value="/searchNotifyOrderListNew") + public R searchNotifyOrderListNew(@RequestBody SOIssueNotifyHeaderData data) { + try { + List rows = newIssureService.searchNotifyOrderListNew(data); + return R.ok().put("rows", rows); + } catch (Exception e) { + return R.error("查询申请单明细失败: " + e.getMessage()); + } + } + + /** + * @Description 查询材料明细 - AI制作 + * @Title searchNotifyMaterialListNew + * @param data 查询条件 + * @return R + * @author AI制作 + * @date 2024/12/19 + */ + @PostMapping(value="/searchNotifyMaterialListNew") + public R searchNotifyMaterialListNew(@RequestBody SOIssueNotifyHeaderData data) { + try { + List rows = newIssureService.searchNotifyMaterialListNew(data); + return R.ok().put("rows", rows); + } catch (Exception e) { + return R.error("查询材料明细失败: " + e.getMessage()); + } + } + + /** + * @Description 查询材料汇总 - AI制作 + * @Title searchSumNotifyMaterialListNew + * @param data 查询条件 + * @return R + * @author AI制作 + * @date 2024/12/19 + */ + @PostMapping(value="/searchSumNotifyMaterialListNew") + public R searchSumNotifyMaterialListNew(@RequestBody SOIssueNotifyHeaderData data) { + try { + List rows = newIssureService.searchSumNotifyMaterialListNew(data); + return R.ok().put("rows", rows); + } catch (Exception e) { + return R.error("查询材料汇总失败: " + e.getMessage()); + } + } + + /** + * @Description 更新申请单状态为关闭 - AI制作 + * @Title updateNotifyStatusNew + * @param data 更新条件 + * @return R + * @author AI制作 + * @date 2024/12/19 + */ + @PostMapping(value="/updateNotifyStatusNew") + public R updateNotifyStatusNew(@RequestBody SOIssueNotifyHeaderData data) { + try { + newIssureService.updateNotifyStatusNew(data); + return R.ok(); + } catch (Exception e) { + return R.error("更新申请单状态失败: " + e.getMessage()); + } + } + + /** + * @Description 查询申请单日志 - AI制作 + * @Title searchNotifyLogNew + * @param data 查询条件 + * @return R + * @author AI制作 + * @date 2024/12/19 + */ + @PostMapping(value="/searchNotifyLogNew") + public R searchNotifyLogNew(@RequestBody SOIssueNotifyHeaderData data) { + try { + List rows = newIssureService.searchNotifyLogNew(data); + return R.ok().put("rows", rows); + } catch (Exception e) { + return R.error("查询申请单日志失败: " + e.getMessage()); + } + } + + /** + * @Description 查询申请单关闭日志 - AI制作 + * @Title searchNotifyLogCloseNew + * @param data 查询条件 + * @return R + * @author AI制作 + * @date 2024/12/19 + */ + @PostMapping(value="/searchNotifyLogCloseNew") + public R searchNotifyLogCloseNew(@RequestBody SOIssueNotifyHeaderData data) { + try { + List rows = newIssureService.searchNotifyLogCloseNew(data); + return R.ok().put("rows", rows); } catch (Exception e) { - System.err.println("Excel文件处理异常: " + e.getMessage()); - e.printStackTrace(); - return R.error("Excel文件处理失败: " + e.getMessage()); + return R.error("查询申请单关闭日志失败: " + e.getMessage()); } } } diff --git a/src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyOrderMaterialListData.java b/src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyOrderMaterialListData.java index 19b5e0b..3b15a08 100644 --- a/src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyOrderMaterialListData.java +++ b/src/main/java/com/gaotao/modules/notify/entity/SOIssueNotifyOrderMaterialListData.java @@ -18,6 +18,8 @@ public class SOIssueNotifyOrderMaterialListData extends SOIssueNotifyOrderMateri private Double qtyOnHand; private Double qtyAvailable; private String orderNo; + private String soorderNo; + private String fgpartNo; private String locationNo; private String str; private Double stockQty; diff --git a/src/main/java/com/gaotao/modules/notify/mapper/NewIssureMapper.java b/src/main/java/com/gaotao/modules/notify/mapper/NewIssureMapper.java index c52f156..68279a4 100644 --- a/src/main/java/com/gaotao/modules/notify/mapper/NewIssureMapper.java +++ b/src/main/java/com/gaotao/modules/notify/mapper/NewIssureMapper.java @@ -2,7 +2,11 @@ package com.gaotao.modules.notify.mapper; import com.gaotao.modules.base.entity.SOScheduledRoutingData; import com.gaotao.modules.notify.entity.SOIssueNotifyOrderList; +import com.gaotao.modules.notify.entity.SOIssueNotifyHeaderData; +import com.gaotao.modules.notify.entity.SOIssueNotifyOrderListData; import com.gaotao.modules.notify.entity.SOIssueNotifyOrderMaterialListData; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.metadata.IPage; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -28,7 +32,42 @@ public interface NewIssureMapper { void deleteSOIssueNotifyOrderMaterialListDataForExcel(SOIssueNotifyOrderMaterialListData data); /** - * 获取已保存的申请单物料明细(用于回显) + * 获取已保存的申请单物料明细(用于回显) - AI制作 */ List getSOSBOMForIssureNew(SOScheduledRoutingData data); + + /** + * 查询申请单主表 - AI制作 + */ + IPage searchNotifyHeaderNew(Page page, @Param("query") SOIssueNotifyHeaderData data); + + /** + * 查询申请单明细 - AI制作 + */ + List searchNotifyOrderListNew(SOIssueNotifyHeaderData data); + + /** + * 查询材料明细 - AI制作 + */ + List searchNotifyMaterialListNew(SOIssueNotifyHeaderData data); + + /** + * 查询材料汇总 - AI制作 + */ + List searchSumNotifyMaterialListNew(SOIssueNotifyHeaderData data); + + /** + * 更新申请单状态为关闭 - AI制作 + */ + void updateNotifyStatusNew(SOIssueNotifyHeaderData data); + + /** + * 查询申请单日志 - AI制作 + */ + List searchNotifyLogNew(SOIssueNotifyHeaderData data); + + /** + * 查询申请单关闭日志 - AI制作 + */ + List searchNotifyLogCloseNew(SOIssueNotifyHeaderData data); } diff --git a/src/main/java/com/gaotao/modules/notify/service/NewIssureService.java b/src/main/java/com/gaotao/modules/notify/service/NewIssureService.java index 06ac47b..7a9eb32 100644 --- a/src/main/java/com/gaotao/modules/notify/service/NewIssureService.java +++ b/src/main/java/com/gaotao/modules/notify/service/NewIssureService.java @@ -1,9 +1,13 @@ package com.gaotao.modules.notify.service; import com.fasterxml.jackson.core.JsonProcessingException; +import com.gaotao.common.utils.PageUtils; import com.gaotao.modules.base.entity.SOScheduledRoutingData; import com.gaotao.modules.notify.entity.NotifyExcelData; +import com.gaotao.modules.notify.entity.SOIssueNotifyHeaderData; +import com.gaotao.modules.notify.entity.SOIssueNotifyOrderListData; import com.gaotao.modules.notify.entity.SOIssueNotifyOrderMaterialListData; +import com.gaotao.common.utils.R; import org.springframework.web.multipart.MultipartFile; import java.util.List; @@ -13,15 +17,84 @@ public interface NewIssureService { List getSOSBOMForIssureNew(SOScheduledRoutingData data) throws JsonProcessingException; /** - * @Description Excel文件上传并解析 + * @Description Excel文件上传并解析 - AI制作 * @Title uploadNotifyExcel * @param file Excel文件 * @param site 工厂编码 * @param notifyNo 申请单号 - * @author system + * @author AI制作 * @date 2024/12/19 * @return void * @throws Exception */ void uploadNotifyExcel(MultipartFile file, String site, String notifyNo) throws Exception; + + /** + * @Description 查询申请单主表 - AI制作 + * @Title searchNotifyHeaderNew + * @param data 查询条件 + * @return PageUtils + * @author AI制作 + * @date 2024/12/19 + */ + PageUtils searchNotifyHeaderNew(SOIssueNotifyHeaderData data); + + /** + * @Description 查询申请单明细 - AI制作 + * @Title searchNotifyOrderListNew + * @param data 查询条件 + * @return List + * @author AI制作 + * @date 2024/12/19 + */ + List searchNotifyOrderListNew(SOIssueNotifyHeaderData data); + + /** + * @Description 查询材料明细 - AI制作 + * @Title searchNotifyMaterialListNew + * @param data 查询条件 + * @return List + * @author AI制作 + * @date 2024/12/19 + */ + List searchNotifyMaterialListNew(SOIssueNotifyHeaderData data); + + /** + * @Description 查询材料汇总 - AI制作 + * @Title searchSumNotifyMaterialListNew + * @param data 查询条件 + * @return List + * @author AI制作 + * @date 2024/12/19 + */ + List searchSumNotifyMaterialListNew(SOIssueNotifyHeaderData data); + + /** + * @Description 更新申请单状态为关闭 - AI制作 + * @Title updateNotifyStatusNew + * @param data 更新条件 + * @author AI制作 + * @date 2024/12/19 + */ + void updateNotifyStatusNew(SOIssueNotifyHeaderData data); + + /** + * @Description 查询申请单日志 - AI制作 + * @Title searchNotifyLogNew + * @param data 查询条件 + * @return List + * @author AI制作 + * @date 2024/12/19 + */ + List searchNotifyLogNew(SOIssueNotifyHeaderData data); + + /** + * @Description 查询申请单关闭日志 - AI制作 + * @Title searchNotifyLogCloseNew + * @param data 查询条件 + * @return List + * @author AI制作 + * @date 2024/12/19 + */ + List searchNotifyLogCloseNew(SOIssueNotifyHeaderData data); } diff --git a/src/main/java/com/gaotao/modules/notify/service/impl/NewIssureServiceImpl.java b/src/main/java/com/gaotao/modules/notify/service/impl/NewIssureServiceImpl.java index 059bc60..d2e7419 100644 --- a/src/main/java/com/gaotao/modules/notify/service/impl/NewIssureServiceImpl.java +++ b/src/main/java/com/gaotao/modules/notify/service/impl/NewIssureServiceImpl.java @@ -1,12 +1,19 @@ package com.gaotao.modules.notify.service.impl; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.fasterxml.jackson.core.JsonProcessingException; import com.gaotao.common.utils.ExcelUtil; +import com.gaotao.common.utils.R; +import com.gaotao.common.utils.PageUtils; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.gaotao.modules.api.entity.IfsShopOrder; import com.gaotao.modules.api.service.IfsApiService; import com.gaotao.modules.base.entity.SOScheduledRoutingData; import com.gaotao.modules.notify.entity.NotifyExcelData; +import com.gaotao.modules.notify.entity.SOIssueNotifyHeaderData; import com.gaotao.modules.notify.entity.SOIssueNotifyOrderList; +import com.gaotao.modules.notify.entity.SOIssueNotifyOrderListData; import com.gaotao.modules.notify.entity.SOIssueNotifyOrderMaterialListData; import com.gaotao.modules.notify.entity.vo.ShopOrderMaterialVo; import com.gaotao.modules.notify.mapper.NewIssureMapper; @@ -366,4 +373,135 @@ public class NewIssureServiceImpl implements NewIssureService { throw new RuntimeException("工单处理失败: " + orderNo + "-" + releaseNo + "-" + sequenceNo + ", 原因: " + e.getMessage(), e); } } + + /** + * @Description 查询申请单主表 - AI制作 + * @Title searchNotifyHeaderNew + * @param data 查询条件 + * @return PageUtils + * @author AI制作 + * @date 2024/12/19 + */ + @Override + public PageUtils searchNotifyHeaderNew(SOIssueNotifyHeaderData data) { + System.out.println("开始查询申请单主表 - AI制作"); + + // 按照原有模式进行分页查询 + IPage resultList = newIssureMapper.searchNotifyHeaderNew( + new Page(data.getPage(), data.getLimit()), data); + PageUtils pageResult = new PageUtils(resultList); + + System.out.println("查询申请单主表完成,共" + resultList.getTotal() + "条记录"); + + return pageResult; + } + + /** + * @Description 查询申请单明细 - AI制作 + * @Title searchNotifyOrderListNew + * @param data 查询条件 + * @return List + * @author AI制作 + * @date 2024/12/19 + */ + @Override + public List searchNotifyOrderListNew(SOIssueNotifyHeaderData data) { + System.out.println("开始查询申请单明细 - AI制作,notifyNo=" + data.getNotifyNo() + ", site=" + data.getSite()); + + List list = newIssureMapper.searchNotifyOrderListNew(data); + + System.out.println("查询申请单明细完成,共" + list.size() + "条记录"); + return list; + } + + /** + * @Description 查询材料明细 - AI制作 + * @Title searchNotifyMaterialListNew + * @param data 查询条件 + * @return List + * @author AI制作 + * @date 2024/12/19 + */ + @Override + public List searchNotifyMaterialListNew(SOIssueNotifyHeaderData data) { + System.out.println("开始查询材料明细 - AI制作,notifyNo=" + data.getNotifyNo() + ", site=" + data.getSite()); + + List list = newIssureMapper.searchNotifyMaterialListNew(data); + + System.out.println("查询材料明细完成,共" + list.size() + "条记录"); + return list; + } + + /** + * @Description 查询材料汇总 - AI制作 + * @Title searchSumNotifyMaterialListNew + * @param data 查询条件 + * @return List + * @author AI制作 + * @date 2024/12/19 + */ + @Override + public List searchSumNotifyMaterialListNew(SOIssueNotifyHeaderData data) { + System.out.println("开始查询材料汇总 - AI制作,notifyNo=" + data.getNotifyNo() + ", site=" + data.getSite()); + + List list = newIssureMapper.searchSumNotifyMaterialListNew(data); + + System.out.println("查询材料汇总完成,共" + list.size() + "条记录"); + return list; + } + + /** + * @Description 更新申请单状态为关闭 - AI制作 + * @Title updateNotifyStatusNew + * @param data 更新条件 + * @author AI制作 + * @date 2024/12/19 + */ + @Override + @Transactional + public void updateNotifyStatusNew(SOIssueNotifyHeaderData data) { + System.out.println("开始更新申请单状态为关闭 - AI制作,notifyNo=" + data.getNotifyNo() + ", site=" + data.getSite()); + + // 设置状态为CLOSED + // data.setStatus("CLOSED"); + newIssureMapper.updateNotifyStatusNew(data); + + System.out.println("更新申请单状态为关闭完成"); + } + + /** + * @Description 查询申请单日志 - AI制作 + * @Title searchNotifyLogNew + * @param data 查询条件 + * @return List + * @author AI制作 + * @date 2024/12/19 + */ + @Override + public List searchNotifyLogNew(SOIssueNotifyHeaderData data) { + System.out.println("开始查询申请单日志 - AI制作,notifyNo=" + data.getNotifyNo() + ", site=" + data.getSite()); + + List list = newIssureMapper.searchNotifyLogNew(data); + + System.out.println("查询申请单日志完成,共" + list.size() + "条记录"); + return list; + } + + /** + * @Description 查询申请单关闭日志 - AI制作 + * @Title searchNotifyLogCloseNew + * @param data 查询条件 + * @return List + * @author AI制作 + * @date 2024/12/19 + */ + @Override + public List searchNotifyLogCloseNew(SOIssueNotifyHeaderData data) { + System.out.println("开始查询申请单关闭日志 - AI制作,notifyNo=" + data.getNotifyNo() + ", site=" + data.getSite()); + + List list = newIssureMapper.searchNotifyLogCloseNew(data); + + System.out.println("查询申请单关闭日志完成,共" + list.size() + "条记录"); + return list; + } } diff --git a/src/main/resources/mapper/notify/IssureNotifyMapper.xml b/src/main/resources/mapper/notify/IssureNotifyMapper.xml index 8960d3f..7ed0b67 100644 --- a/src/main/resources/mapper/notify/IssureNotifyMapper.xml +++ b/src/main/resources/mapper/notify/IssureNotifyMapper.xml @@ -157,7 +157,7 @@ record_version,out_work_order_flag,project_id,order_type,auth_rule_id,bu) - update SOIssueNotifyHeader set plan_issue_date=#{planIssueDate},remark=#{remark} ,status='ISSUE' where site=#{site} and NotifyNo=#{notifyNo} + update SOIssueNotifyHeader set plan_issue_date=#{planIssueDate},remark=#{remark} ,status='ISSUE' where site=#{site} and notify_no=#{notifyNo} @@ -169,10 +169,10 @@ record_version,out_work_order_flag,project_id,order_type,auth_rule_id,bu) a.issue_result,a.plan_issue_date,a.real_issue_date,a.status,a.have_issue_record_flag,a.calc_flag,a.need_approve_flag,a.approved_flag, a.approver,a.approve_date,a.warehouse_id,a.record_version,a.out_work_order_flag,a.project_id,a.order_type,a.auth_rule_id,(CASE WHEN a.confirm_status IS NULL THEN '未确认' ELSE a.confirm_status END) as confirm_status ,dbo.plm_get_user_display(a.site,a.username) userDisplay, a.confirm_user_id,a.confirm_username,a.confirm_user_display,a.confirm_date, - c.workShopName + from SOIssueNotifyHeader a left join sys_user b on a.username=b.username - left join eam_WorkShop c on b.workShopId=c.workShopId + @@ -184,12 +184,7 @@ record_version,out_work_order_flag,project_id,order_type,auth_rule_id,bu) AND a.username LIKE #{query.username} - - AND a.issueFlag LIKE #{query.issueFlag} - - - AND a.issueResult LIKE #{query.issueResult} - + AND a.notify_date >= #{query.startDate} @@ -209,9 +204,7 @@ record_version,out_work_order_flag,project_id,order_type,auth_rule_id,bu) ${query.sql} - - AND b.workShopId in ${query.workShopId} - + order by a.notify_no diff --git a/src/main/resources/mapper/notify/NewIssureMapper.xml b/src/main/resources/mapper/notify/NewIssureMapper.xml index bb48771..b5ffe42 100644 --- a/src/main/resources/mapper/notify/NewIssureMapper.xml +++ b/src/main/resources/mapper/notify/NewIssureMapper.xml @@ -30,4 +30,84 @@ and b.release_no=#{releaseNo} and b.sequence_no=#{sequenceNo} + + + + + + + + + + + + + + + update SOIssueNotifyHeader + set status=#{status}, remark=#{closeRemark} + where site=#{site} and notify_no=#{notifyNo} + + + + + + + + \ No newline at end of file