优化导入,格式化时间,新增删除接口

This commit is contained in:
syruan 2024-03-14 13:36:51 +08:00
parent e24109076c
commit ca1980fdd6
5 changed files with 54 additions and 46 deletions

View File

@ -122,6 +122,7 @@ public class MaType extends BaseEntity {
private String createBy; private String createBy;
/** 创建时间 */ /** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private Date createTime; private Date createTime;
@ -130,6 +131,7 @@ public class MaType extends BaseEntity {
private String updateBy; private String updateBy;
/** 更新时间 */ /** 更新时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新时间") @ApiModelProperty(value = "更新时间")
private Date updateTime; private Date updateTime;

View File

@ -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.domain.vo.TreeSelect;
import com.bonus.sgzb.base.mapper.MaTypeMapper; import com.bonus.sgzb.base.mapper.MaTypeMapper;
import com.bonus.sgzb.base.service.ITypeService; 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.controller.BaseController;
import com.bonus.sgzb.common.core.web.domain.AjaxResult; 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.annotation.Log;
import com.bonus.sgzb.common.log.enums.BusinessType; import com.bonus.sgzb.common.log.enums.BusinessType;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -17,8 +15,6 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/** /**
* 工机具类型管理控制层 * 工机具类型管理控制层
@ -69,7 +65,6 @@ public class MaTypeController extends BaseController {
* @param typeId * @param typeId
* @return * @return
*/ */
@ApiOperation(value = "工器具类型") @ApiOperation(value = "工器具类型")
@GetMapping("/equipmentType") @GetMapping("/equipmentType")
public AjaxResult equipmentType(@RequestParam(required = false) Long typeId, public AjaxResult equipmentType(@RequestParam(required = false) Long typeId,
@ -196,30 +191,30 @@ public class MaTypeController extends BaseController {
return success(listByMaType); return success(listByMaType);
} }
/* *//** /**
* 根据左列表类型id查询右表格 * 根据左列表类型id查询右表格
* @param typeId * @param typeId
* @return * @return
*//* */
@ApiOperation(value = "根据左列表类型id查询右表格") // @ApiOperation(value = "根据左列表类型id查询右表格")
@GetMapping("/getListByMaType") // @GetMapping("/getListByMaType")
public TableDataInfo getListByMaType(@RequestParam(required = false) Long typeId, // public TableDataInfo getListByMaType(@RequestParam(required = false) Long typeId,
@RequestParam(required = false) String typeName, // @RequestParam(required = false) String typeName,
@RequestParam(required = false) Integer pageSize, // @RequestParam(required = false) Integer pageSize,
@RequestParam(required = false) Integer pageNum){ // @RequestParam(required = false) Integer pageNum){
if(typeId==null){ // if(typeId==null){
return null; // return null;
} // }
List<MaType> listByMaType = iTypeService.getListByMaType(typeId, typeName); // List<MaType> listByMaType = iTypeService.getListByMaType(typeId, typeName);
TableDataInfo rspData = new TableDataInfo(); // TableDataInfo rspData = new TableDataInfo();
rspData.setTotal(listByMaType.size()); // rspData.setTotal(listByMaType.size());
rspData.setCode(HttpStatus.SUCCESS); // rspData.setCode(HttpStatus.SUCCESS);
// listByMaType = listByMaType.stream().skip((long) (pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); // // listByMaType = listByMaType.stream().skip((long) (pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
rspData.setRows(listByMaType); // rspData.setRows(listByMaType);
rspData.setMsg("查询成功"); // rspData.setMsg("查询成功");
//
return rspData; // return rspData;
}*/ // }
/** /**
* 获取机具类型管理ma_type详细信息 * 获取机具类型管理ma_type详细信息

View File

@ -1,21 +1,22 @@
package com.bonus.sgzb.material.controller; package com.bonus.sgzb.material.controller;
import java.util.List; import com.bonus.sgzb.common.core.utils.poi.ExcelUtil;
import javax.servlet.http.HttpServletResponse; 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.domain.PurchaseInput;
import com.bonus.sgzb.material.service.IPurchaseCheckInfoService; import com.bonus.sgzb.material.service.IPurchaseCheckInfoService;
import com.bonus.sgzb.material.domain.PurchaseCheckInfo;
import com.bonus.sgzb.material.vo.NoticeInfoVO; import com.bonus.sgzb.material.vo.NoticeInfoVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.bonus.sgzb.common.log.annotation.Log;
import com.bonus.sgzb.common.log.enums.BusinessType; import javax.servlet.http.HttpServletResponse;
import com.bonus.sgzb.common.core.web.controller.BaseController; import java.util.List;
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;
/** /**
* 新购验收任务 * 新购验收任务
@ -138,9 +139,9 @@ public class PurchaseCheckInfoController extends BaseController
*/ */
@ApiOperation("删除新购验收任务") @ApiOperation("删除新购验收任务")
@Log(title = "新购验收任务", businessType = BusinessType.DELETE) @Log(title = "新购验收任务", businessType = BusinessType.DELETE)
@DeleteMapping("/{taskIds}") @DeleteMapping("/{taskId}")
public AjaxResult remove(@PathVariable Long[] taskIds) public AjaxResult remove(@PathVariable Long taskId)
{ {
return toAjax(purchaseCheckInfoService.deletePurchaseCheckInfoByTaskIds(taskIds)); return toAjax(purchaseCheckInfoService.deletePurchaseCheckInfoByTaskId(taskId));
} }
} }

View File

@ -1,11 +1,10 @@
package com.bonus.sgzb.material.service.impl; 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.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.material.domain.AgreementInfo; import com.bonus.sgzb.material.domain.AgreementInfo;
import com.bonus.sgzb.material.mapper.AgreementInfoMapper; import com.bonus.sgzb.material.mapper.AgreementInfoMapper;
import com.bonus.sgzb.material.service.AgreementInfoService; import com.bonus.sgzb.material.service.AgreementInfoService;
import com.bonus.sgzb.common.core.utils.DateUtils;
import com.bonus.sgzb.material.vo.GlobalContants; import com.bonus.sgzb.material.vo.GlobalContants;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;

View File

@ -1,16 +1,12 @@
package com.bonus.sgzb.material.service.impl; package com.bonus.sgzb.material.service.impl;
import java.text.SimpleDateFormat; import com.bonus.sgzb.common.core.utils.DateUtils;
import java.util.Date;
import java.util.List;
import com.bonus.sgzb.common.security.utils.SecurityUtils; import com.bonus.sgzb.common.security.utils.SecurityUtils;
import com.bonus.sgzb.material.domain.*; import com.bonus.sgzb.material.domain.*;
import com.bonus.sgzb.material.mapper.PurchaseCheckDetailsMapper; import com.bonus.sgzb.material.mapper.PurchaseCheckDetailsMapper;
import com.bonus.sgzb.material.mapper.PurchaseCheckInfoMapper; import com.bonus.sgzb.material.mapper.PurchaseCheckInfoMapper;
import com.bonus.sgzb.material.mapper.TaskMapper; import com.bonus.sgzb.material.mapper.TaskMapper;
import com.bonus.sgzb.material.service.IPurchaseCheckInfoService; 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.GlobalContants;
import com.bonus.sgzb.material.vo.NoticeInfoVO; import com.bonus.sgzb.material.vo.NoticeInfoVO;
import com.bonus.sgzb.system.api.RemoteUserService; import com.bonus.sgzb.system.api.RemoteUserService;
@ -18,6 +14,9 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/** /**
* 新购验收任务Service业务层处理 * 新购验收任务Service业务层处理
@ -216,7 +215,19 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
*/ */
@Override @Override
public int deletePurchaseCheckInfoByTaskId(Long taskId) { 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;
} }
/** /**