From ca1980fdd62720e83c949870c090ab9d4ba80c84 Mon Sep 17 00:00:00 2001 From: syruan <321359594@qq.com> Date: Thu, 14 Mar 2024 13:36:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AF=BC=E5=85=A5=EF=BC=8C?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E6=97=B6=E9=97=B4=EF=BC=8C=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=88=A0=E9=99=A4=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bonus/sgzb/base/api/domain/MaType.java | 2 + .../base/controller/MaTypeController.java | 47 +++++++++---------- .../PurchaseCheckInfoController.java | 25 +++++----- .../impl/AgreementInfoServiceImpl.java | 3 +- .../impl/PurchaseCheckInfoServiceImpl.java | 23 ++++++--- 5 files changed, 54 insertions(+), 46 deletions(-) diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaType.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaType.java index a54bcd41..c76133f0 100644 --- a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaType.java +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaType.java @@ -122,6 +122,7 @@ public class MaType extends BaseEntity { private String createBy; /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "创建时间") private Date createTime; @@ -130,6 +131,7 @@ public class MaType extends BaseEntity { private String updateBy; /** 更新时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "更新时间") private Date updateTime; diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaTypeController.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaTypeController.java index 883f9581..b4b62d88 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaTypeController.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/MaTypeController.java @@ -4,10 +4,8 @@ import com.bonus.sgzb.base.api.domain.MaType; import com.bonus.sgzb.base.domain.vo.TreeSelect; import com.bonus.sgzb.base.mapper.MaTypeMapper; import com.bonus.sgzb.base.service.ITypeService; -import com.bonus.sgzb.common.core.constant.HttpStatus; import com.bonus.sgzb.common.core.web.controller.BaseController; import com.bonus.sgzb.common.core.web.domain.AjaxResult; -import com.bonus.sgzb.common.core.web.page.TableDataInfo; import com.bonus.sgzb.common.log.annotation.Log; import com.bonus.sgzb.common.log.enums.BusinessType; import io.swagger.annotations.Api; @@ -17,8 +15,6 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; /** * 工机具类型管理控制层 @@ -69,7 +65,6 @@ public class MaTypeController extends BaseController { * @param typeId * @return */ - @ApiOperation(value = "工器具类型") @GetMapping("/equipmentType") public AjaxResult equipmentType(@RequestParam(required = false) Long typeId, @@ -196,30 +191,30 @@ public class MaTypeController extends BaseController { return success(listByMaType); } -/* *//** + /** * 根据左列表类型id查询右表格 * @param typeId * @return - *//* - @ApiOperation(value = "根据左列表类型id查询右表格") - @GetMapping("/getListByMaType") - public TableDataInfo getListByMaType(@RequestParam(required = false) Long typeId, - @RequestParam(required = false) String typeName, - @RequestParam(required = false) Integer pageSize, - @RequestParam(required = false) Integer pageNum){ - if(typeId==null){ - return null; - } - List listByMaType = iTypeService.getListByMaType(typeId, typeName); - TableDataInfo rspData = new TableDataInfo(); - rspData.setTotal(listByMaType.size()); - rspData.setCode(HttpStatus.SUCCESS); -// listByMaType = listByMaType.stream().skip((long) (pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); - rspData.setRows(listByMaType); - rspData.setMsg("查询成功"); - - return rspData; - }*/ + */ +// @ApiOperation(value = "根据左列表类型id查询右表格") +// @GetMapping("/getListByMaType") +// public TableDataInfo getListByMaType(@RequestParam(required = false) Long typeId, +// @RequestParam(required = false) String typeName, +// @RequestParam(required = false) Integer pageSize, +// @RequestParam(required = false) Integer pageNum){ +// if(typeId==null){ +// return null; +// } +// List listByMaType = iTypeService.getListByMaType(typeId, typeName); +// TableDataInfo rspData = new TableDataInfo(); +// rspData.setTotal(listByMaType.size()); +// rspData.setCode(HttpStatus.SUCCESS); +// // listByMaType = listByMaType.stream().skip((long) (pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); +// rspData.setRows(listByMaType); +// rspData.setMsg("查询成功"); +// +// return rspData; +// } /** * 获取机具类型管理ma_type详细信息 diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/PurchaseCheckInfoController.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/PurchaseCheckInfoController.java index 31bc3fc7..4f537e1e 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/PurchaseCheckInfoController.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/PurchaseCheckInfoController.java @@ -1,21 +1,22 @@ package com.bonus.sgzb.material.controller; -import java.util.List; -import javax.servlet.http.HttpServletResponse; +import com.bonus.sgzb.common.core.utils.poi.ExcelUtil; +import com.bonus.sgzb.common.core.web.controller.BaseController; +import com.bonus.sgzb.common.core.web.domain.AjaxResult; +import com.bonus.sgzb.common.core.web.page.TableDataInfo; +import com.bonus.sgzb.common.log.annotation.Log; +import com.bonus.sgzb.common.log.enums.BusinessType; +import com.bonus.sgzb.material.domain.PurchaseCheckInfo; import com.bonus.sgzb.material.domain.PurchaseInput; import com.bonus.sgzb.material.service.IPurchaseCheckInfoService; -import com.bonus.sgzb.material.domain.PurchaseCheckInfo; import com.bonus.sgzb.material.vo.NoticeInfoVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import com.bonus.sgzb.common.log.annotation.Log; -import com.bonus.sgzb.common.log.enums.BusinessType; -import com.bonus.sgzb.common.core.web.controller.BaseController; -import com.bonus.sgzb.common.core.web.domain.AjaxResult; -import com.bonus.sgzb.common.core.utils.poi.ExcelUtil; -import com.bonus.sgzb.common.core.web.page.TableDataInfo; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; /** * 新购验收任务 @@ -138,9 +139,9 @@ public class PurchaseCheckInfoController extends BaseController */ @ApiOperation("删除新购验收任务") @Log(title = "新购验收任务", businessType = BusinessType.DELETE) - @DeleteMapping("/{taskIds}") - public AjaxResult remove(@PathVariable Long[] taskIds) + @DeleteMapping("/{taskId}") + public AjaxResult remove(@PathVariable Long taskId) { - return toAjax(purchaseCheckInfoService.deletePurchaseCheckInfoByTaskIds(taskIds)); + return toAjax(purchaseCheckInfoService.deletePurchaseCheckInfoByTaskId(taskId)); } } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/AgreementInfoServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/AgreementInfoServiceImpl.java index 1164b83a..f76c278b 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/AgreementInfoServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/AgreementInfoServiceImpl.java @@ -1,11 +1,10 @@ package com.bonus.sgzb.material.service.impl; -import com.bonus.sgzb.common.core.utils.StringHelper; +import com.bonus.sgzb.common.core.utils.DateUtils; import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.material.domain.AgreementInfo; import com.bonus.sgzb.material.mapper.AgreementInfoMapper; import com.bonus.sgzb.material.service.AgreementInfoService; -import com.bonus.sgzb.common.core.utils.DateUtils; import com.bonus.sgzb.material.vo.GlobalContants; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseCheckInfoServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseCheckInfoServiceImpl.java index 3fb7eb68..13d95e48 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseCheckInfoServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseCheckInfoServiceImpl.java @@ -1,16 +1,12 @@ package com.bonus.sgzb.material.service.impl; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; - +import com.bonus.sgzb.common.core.utils.DateUtils; import com.bonus.sgzb.common.security.utils.SecurityUtils; import com.bonus.sgzb.material.domain.*; import com.bonus.sgzb.material.mapper.PurchaseCheckDetailsMapper; import com.bonus.sgzb.material.mapper.PurchaseCheckInfoMapper; import com.bonus.sgzb.material.mapper.TaskMapper; import com.bonus.sgzb.material.service.IPurchaseCheckInfoService; -import com.bonus.sgzb.common.core.utils.DateUtils; import com.bonus.sgzb.material.vo.GlobalContants; import com.bonus.sgzb.material.vo.NoticeInfoVO; import com.bonus.sgzb.system.api.RemoteUserService; @@ -18,6 +14,9 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; /** * 新购验收任务Service业务层处理 @@ -216,7 +215,19 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService { */ @Override public int deletePurchaseCheckInfoByTaskId(Long taskId) { - return purchaseCheckInfoMapper.deletePurchaseCheckInfoByTaskId(taskId); + int result = 0; + try { + // 第一步:删除验收任务表 + purchaseCheckInfoMapper.deletePurchaseCheckInfoByTaskId(taskId); + // 第二步:删除验收任务详情表 + purchaseCheckDetailsMapper.deleteCheckDetailsByTaskId(taskId); + // 第三步:删除任务表 + taskMapper.deleteTmTaskByTaskId(taskId); + result = 1; + } catch (Exception e) { + throw new RuntimeException(e); + } + return result; } /**