sonar代码异味修改

This commit is contained in:
15856 2024-07-24 13:31:26 +08:00
parent 8aac72612e
commit 5734099add
6 changed files with 38 additions and 56 deletions

View File

@ -1,7 +1,6 @@
package com.bonus.sgzb.app.controller;
import com.bonus.sgzb.app.domain.AppVersion;
import com.bonus.sgzb.app.domain.BackApplyInfo;
import com.bonus.sgzb.app.domain.CriticalData;
import com.bonus.sgzb.app.domain.ToDoList;
import com.bonus.sgzb.app.service.AppService;
@ -53,12 +52,8 @@ public class AppController {
@Log(title = "获取app版本信息", businessType = BusinessType.QUERY)
@GetMapping("/getVersion")
public AjaxResult getVersion() {
try {
List<AppVersion> list = service.getVersion();
return success(list);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}

View File

@ -5,11 +5,8 @@ import com.bonus.sgzb.app.domain.BackApplyInfo;
import com.bonus.sgzb.app.domain.BmAgreementInfo;
import com.bonus.sgzb.app.domain.TmTask;
import com.bonus.sgzb.app.service.BackApplyService;
import com.bonus.sgzb.app.service.LeaseApplyDetailsService;
import com.bonus.sgzb.app.service.LeaseApplyInfoService;
import com.bonus.sgzb.app.service.TmTaskService;
import com.bonus.sgzb.common.core.utils.DateUtils;
import com.bonus.sgzb.common.core.utils.GlobalConstants;
import com.bonus.sgzb.common.core.utils.StringHelper;
import com.bonus.sgzb.common.core.utils.StringUtils;
import com.bonus.sgzb.common.core.web.controller.BaseController;
@ -46,19 +43,18 @@ public class BackApplyController extends BaseController {
/**
* 退料申请列表
*
* @param record 查询条件
* @param backApplyInfo 查询条件
* @return AjaxResult对象
*/
@Log(title = "退料申请列表", businessType = BusinessType.QUERY)
@PostMapping("getbackList")
public AjaxResult getbackList(@RequestBody BackApplyInfo record) {
try {
record.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
List<BackApplyInfo> list = backApplyService.getbackList(record);
@PostMapping("/getbackList")
public AjaxResult getbackList(@RequestBody BackApplyInfo backApplyInfo) {
logger.info("BackApplyController getbackList begin :");
backApplyInfo.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
List<BackApplyInfo> list = backApplyService.getbackList(backApplyInfo);
logger.info("BackApplyController getbackList end :");
return success(list);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
@ -69,9 +65,9 @@ public class BackApplyController extends BaseController {
*/
@Log(title = "获取退料物料列表", businessType = BusinessType.QUERY)
@PostMapping("materialList")
public AjaxResult materialList(@RequestBody BackApplyInfo record) {
public AjaxResult materialList(@RequestBody BackApplyInfo backApplyInfo) {
try {
List<BackApplyInfo> list = backApplyService.materialList(record);
List<BackApplyInfo> list = backApplyService.materialList(backApplyInfo);
return success(list);
} catch (Exception e) {
throw new RuntimeException(e);
@ -81,14 +77,13 @@ public class BackApplyController extends BaseController {
/**
* 详情查看
*
* @param record 查询条件
* @return AjaxResult对象
*/
@Log(title = "退料详情查看", businessType = BusinessType.QUERY)
@PostMapping("view")
public AjaxResult view(@RequestBody BackApplyInfo record) {
public AjaxResult view(@RequestBody BackApplyInfo backApplyInfo) {
try {
List<BackApplyInfo> list = backApplyService.view(record);
List<BackApplyInfo> list = backApplyService.view(backApplyInfo);
return success(list);
} catch (Exception e) {
throw new RuntimeException(e);
@ -98,14 +93,13 @@ public class BackApplyController extends BaseController {
/**
* 退料审核明细
*
* @param record 查询条件
* @return AjaxResult对象
*/
@Log(title = "退料审核明细", businessType = BusinessType.QUERY)
@PostMapping("examineView")
public AjaxResult examineView(@RequestBody BackApplyInfo record) {
public AjaxResult examineView(@RequestBody BackApplyInfo backApplyInfo) {
try {
List<BackApplyInfo> list = backApplyService.examineView(record);
List<BackApplyInfo> list = backApplyService.examineView(backApplyInfo);
return success(list);
} catch (Exception e) {
throw new RuntimeException(e);
@ -115,14 +109,13 @@ public class BackApplyController extends BaseController {
/**
* 删除
*
* @param record 查询条件
* @return AjaxResult对象
*/
@Log(title = "退料删除", businessType = BusinessType.QUERY)
@PostMapping("del")
public AjaxResult del(@RequestBody BackApplyInfo record) {
public AjaxResult del(@RequestBody BackApplyInfo backApplyInfo) {
try {
int re = backApplyService.del(record);
int re = backApplyService.del(backApplyInfo);
if (re > 0) {
return AjaxResult.success("删除成功");
} else {
@ -136,14 +129,13 @@ public class BackApplyController extends BaseController {
/**
* 查询退料单位列表
*
* @param record 查询条件
* @return AjaxResult对象
*/
@Log(title = "退料申请-退料单位", businessType = BusinessType.QUERY)
@PostMapping("getbackUnit")
public AjaxResult getbackUnit(@RequestBody BmAgreementInfo record) {
public AjaxResult getbackUnit(@RequestBody BmAgreementInfo bmAgreementInfo) {
try {
List<BmAgreementInfo> list = backApplyService.getbackUnit(record);
List<BmAgreementInfo> list = backApplyService.getbackUnit(bmAgreementInfo);
return success(list);
} catch (Exception e) {
throw new RuntimeException(e);
@ -153,14 +145,13 @@ public class BackApplyController extends BaseController {
/**
* 查询退料工程列表
*
* @param record 查询条件
* @return AjaxResult对象
*/
@Log(title = "退料申请-退料工程", businessType = BusinessType.QUERY)
@PostMapping("getbackPro")
public AjaxResult getbackPro(@RequestBody BmAgreementInfo record) {
public AjaxResult getbackPro(@RequestBody BmAgreementInfo bmAgreementInfo) {
try {
List<BmAgreementInfo> list = backApplyService.getbackPro(record);
List<BmAgreementInfo> list = backApplyService.getbackPro(bmAgreementInfo);
return success(list);
} catch (Exception e) {
throw new RuntimeException(e);
@ -208,18 +199,17 @@ public class BackApplyController extends BaseController {
/**
* 提交物料型号及数量
*
* @param record 查询条件
* @return AjaxResult对象
*/
@Log(title = "提交物料型号及数量", businessType = BusinessType.UPDATE)
@PostMapping("upload")
public AjaxResult upload(@RequestBody BackApplyInfo record) {
public AjaxResult upload(@RequestBody BackApplyInfo backApplyInfoRequest) {
try {
if (CollUtil.isEmpty(record.getBackApplyDetails())) {
if (CollUtil.isEmpty(backApplyInfoRequest.getBackApplyDetails())) {
return AjaxResult.error("退料设备明细为空,请重新选择后上传!");
}
for (BackApplyInfo backApplyInfo : record.getBackApplyDetails()) {
backApplyInfo.setParentId(record.getParentId());
for (BackApplyInfo backApplyInfo : backApplyInfoRequest.getBackApplyDetails()) {
backApplyInfo.setParentId(backApplyInfoRequest.getParentId());
boolean re = backApplyService.upload(backApplyInfo) > 0;
if (!re) {
return AjaxResult.error("退料任务明细插入失败");
@ -257,18 +247,17 @@ public class BackApplyController extends BaseController {
/**
* 退料审核列表
*
* @param record 查询条件
* @return AjaxResult对象
*/
@Log(title = "获取退料审核列表-app", businessType = BusinessType.QUERY)
@PostMapping("examineList")
public AjaxResult examineList(@RequestBody BackApplyInfo record) {
public AjaxResult examineList(@RequestBody BackApplyInfo backApplyInfo) {
try {
if (StringUtils.isNull(record)) {
if (StringUtils.isNull(backApplyInfo)) {
return AjaxResult.error("参数错误");
}
List<BackApplyInfo> list = backApplyService.examineList(record);
List<BackApplyInfo> list = backApplyService.examineList(backApplyInfo);
return success(list);
} catch (Exception e) {
throw new RuntimeException(e);
@ -279,14 +268,14 @@ public class BackApplyController extends BaseController {
@ApiOperation("退料审核通过-app")
@Log(title = "退料审核通过", businessType = BusinessType.UPDATE)
@PostMapping("/audit")
public AjaxResult audit(@RequestBody BackApplyInfo record) {
return toAjax(backApplyService.audit(record));
public AjaxResult audit(@RequestBody BackApplyInfo backApplyInfo) {
return toAjax(backApplyService.audit(backApplyInfo));
}
@ApiOperation("退料审核驳回-app")
@Log(title = "退料审核驳回", businessType = BusinessType.UPDATE)
@PostMapping("/refuse")
public AjaxResult refuse(@RequestBody BackApplyInfo record) {
return toAjax(backApplyService.refuse(record));
public AjaxResult refuse(@RequestBody BackApplyInfo backApplyInfo) {
return toAjax(backApplyService.refuse(backApplyInfo));
}
}

View File

@ -30,14 +30,13 @@ public class BmAgreementInfoController extends BaseController {
/**
* 根据 工程+往来单位 判断是否有权限
*
* @param record 查询条件
* @return AjaxResult对象包含判断结果
*/
@Log(title = "协议管理", businessType = BusinessType.QUERY)
@GetMapping("isPrimaryByProAndUnit")
public AjaxResult isPrimaryByProAndUnit(BmAgreementInfo record) {
public AjaxResult isPrimaryByProAndUnit(BmAgreementInfo bmAgreementInfo) {
try {
return toAjax(bmAgreementInfoMapper.isPrimaryByProAndUnit(record));
return toAjax(bmAgreementInfoMapper.isPrimaryByProAndUnit(bmAgreementInfo));
} catch (Exception e) {
throw new RuntimeException(e);
}

View File

@ -8,7 +8,6 @@ import com.bonus.sgzb.common.log.annotation.Log;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* @Author梁超

View File

@ -39,8 +39,8 @@ public class LeaseOutDetailsController extends BaseController {
@Log(title = "领料出库列表", businessType = BusinessType.QUERY)
@GetMapping("/getLeaseOutRecordList")
public TableDataInfo getLeaseList(@RequestBody LeaseOutDetails record) {
return getDataTable(leaseOutDetailsService.leaseOutRecordList(record));
public TableDataInfo getLeaseList(@RequestBody LeaseOutDetails leaseOutDetails) {
return getDataTable(leaseOutDetailsService.leaseOutRecordList(leaseOutDetails));
}
/**
@ -131,8 +131,8 @@ public class LeaseOutDetailsController extends BaseController {
*/
@Log(title = "领料出库", businessType = BusinessType.MATERIAL)
@PostMapping("/submitOut")
public AjaxResult submitOut(@RequestBody LeaseOutDetails record) {
return leaseOutDetailsService.submitOut(record);
public AjaxResult submitOut(@RequestBody LeaseOutDetails laseOutDetails) {
return leaseOutDetailsService.submitOut(laseOutDetails);
}
/**

View File

@ -156,7 +156,7 @@ public class TmTaskController extends BaseController {
return AjaxResult.error("领料任务信息为空,请重试");
}
if (CollUtil.isEmpty(task.getLeaseApplyDetails())) {
return AjaxResult.error("领料设备明细为空,请重新选择后上传!");
return AjaxResult.error("领料设备明细为空,请重新选择后上传1!");
}
// ------校验结束--执行service-------
return tmTaskService.createFlowLeaseApply(task);