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

View File

@ -30,14 +30,13 @@ public class BmAgreementInfoController extends BaseController {
/** /**
* 根据 工程+往来单位 判断是否有权限 * 根据 工程+往来单位 判断是否有权限
* *
* @param record 查询条件
* @return AjaxResult对象包含判断结果 * @return AjaxResult对象包含判断结果
*/ */
@Log(title = "协议管理", businessType = BusinessType.QUERY) @Log(title = "协议管理", businessType = BusinessType.QUERY)
@GetMapping("isPrimaryByProAndUnit") @GetMapping("isPrimaryByProAndUnit")
public AjaxResult isPrimaryByProAndUnit(BmAgreementInfo record) { public AjaxResult isPrimaryByProAndUnit(BmAgreementInfo bmAgreementInfo) {
try { try {
return toAjax(bmAgreementInfoMapper.isPrimaryByProAndUnit(record)); return toAjax(bmAgreementInfoMapper.isPrimaryByProAndUnit(bmAgreementInfo));
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(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 org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
/** /**
* @Author梁超 * @Author梁超

View File

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

View File

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