修饰批量修改SQL调整
This commit is contained in:
parent
5f0709c5a9
commit
0f7de5c916
|
|
@ -44,7 +44,7 @@ public class RepairController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 获取维修任务列表
|
* 获取维修任务列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "获取维修任务列表")
|
@ApiOperation(value = "获取维修任务列表--分页")
|
||||||
@GetMapping("/getRepairTaskList")
|
@GetMapping("/getRepairTaskList")
|
||||||
@RequiresPermissions(value = "repair:manage:list")
|
@RequiresPermissions(value = "repair:manage:list")
|
||||||
public TableDataInfo getRepairTaskList(RepairTask bean) {
|
public TableDataInfo getRepairTaskList(RepairTask bean) {
|
||||||
|
|
@ -53,6 +53,17 @@ public class RepairController extends BaseController {
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取维修任务列表--不分页--NO_PAGE
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取维修任务列表---不分页")
|
||||||
|
@GetMapping("/getAppRepairTaskList")
|
||||||
|
@RequiresPermissions("repair:manage:list")
|
||||||
|
public AjaxResult getAppRepairTaskList(RepairTask bean) {
|
||||||
|
List<RepairTask> list = service.getRepairTaskList(bean);
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出维修任务列表
|
* 导出维修任务列表
|
||||||
*/
|
*/
|
||||||
|
|
@ -65,16 +76,6 @@ public class RepairController extends BaseController {
|
||||||
util.exportExcel(response, list, "维修任务列表");
|
util.exportExcel(response, list, "维修任务列表");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取维修任务列表--APP
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "获取维修任务列表---APP")
|
|
||||||
@GetMapping("/getAppRepairTaskList")
|
|
||||||
@RequiresPermissions("repair:manage:list")
|
|
||||||
public AjaxResult getAppRepairTaskList(RepairTask bean) {
|
|
||||||
List<RepairTask> list = service.getRepairTaskList(bean);
|
|
||||||
return AjaxResult.success(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取维修任务物资设备列表--不分页
|
* 获取维修任务物资设备列表--不分页
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ public class RepairAuditDetails extends BaseEntity {
|
||||||
/** 0未审核1已审核2驳回 */
|
/** 0未审核1已审核2驳回 */
|
||||||
@Excel(name = "状态", readConverterExp = "0=未审核,1=已审核,2=驳回")
|
@Excel(name = "状态", readConverterExp = "0=未审核,1=已审核,2=驳回")
|
||||||
@ApiModelProperty(value = "0未审核1已审核2驳回")
|
@ApiModelProperty(value = "0未审核1已审核2驳回")
|
||||||
private char status;
|
private String status;
|
||||||
|
|
||||||
/** 数据所属组织 */
|
/** 数据所属组织 */
|
||||||
@ApiModelProperty(value = "数据所属组织")
|
@ApiModelProperty(value = "数据所属组织")
|
||||||
|
|
|
||||||
|
|
@ -64,10 +64,10 @@ public interface RepairAuditDetailsMapper {
|
||||||
/**
|
/**
|
||||||
* 批量修改修试审核详细--批量
|
* 批量修改修试审核详细--批量
|
||||||
*
|
*
|
||||||
* @param repairAuditDetails 批量修试审核详细
|
* @param ids 批量修试审核详细
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int updateRepairAuditDetailsBatch(@Param("ids") List<RepairAuditDetails> repairAuditDetails);
|
int updateRepairAuditDetailsBatch(@Param("ids") List<Long> ids, @Param("status") String status);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除修试审核详细
|
* 删除修试审核详细
|
||||||
|
|
|
||||||
|
|
@ -311,7 +311,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
||||||
if (CollectionUtil.isNotEmpty(auditDetailList)) {
|
if (CollectionUtil.isNotEmpty(auditDetailList)) {
|
||||||
for (RepairAuditDetails bean : auditDetailList) {
|
for (RepairAuditDetails bean : auditDetailList) {
|
||||||
bean.setAuditBy(SecurityUtils.getLoginUser().getUserid());
|
bean.setAuditBy(SecurityUtils.getLoginUser().getUserid());
|
||||||
bean.setStatus(status);
|
bean.setStatus(String.valueOf(status));
|
||||||
bean.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
bean.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||||
bean.setAuditRemark(scrapAudit.getRemark());
|
bean.setAuditRemark(scrapAudit.getRemark());
|
||||||
repairAuditDetailsMapper.updateStatus(bean);
|
repairAuditDetailsMapper.updateStatus(bean);
|
||||||
|
|
@ -321,7 +321,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
||||||
if (auditAllList != null) {
|
if (auditAllList != null) {
|
||||||
for (RepairAuditDetails bean : auditAllList) {
|
for (RepairAuditDetails bean : auditAllList) {
|
||||||
bean.setAuditBy(SecurityUtils.getLoginUser().getUserid());
|
bean.setAuditBy(SecurityUtils.getLoginUser().getUserid());
|
||||||
bean.setStatus(status);
|
bean.setStatus(String.valueOf(status));
|
||||||
bean.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
bean.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||||
bean.setAuditRemark(scrapAudit.getRemark());
|
bean.setAuditRemark(scrapAudit.getRemark());
|
||||||
repairAuditDetailsMapper.updateStatus(bean);
|
repairAuditDetailsMapper.updateStatus(bean);
|
||||||
|
|
@ -452,9 +452,20 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateRepairAuditDetailsBatch(@NotNull List<RepairAuditDetails> repairAuditDetails) {
|
public int updateRepairAuditDetailsBatch(@NotNull List<RepairAuditDetails> repairAuditDetails) {
|
||||||
|
// 提取所有需要更新的 ID
|
||||||
|
List<Long> ids = repairAuditDetails.stream()
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.map(RepairAuditDetails::getId)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
if (ids.isEmpty()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
repairAuditDetails.stream().filter(Objects::nonNull).forEach(item -> item.setUpdateTime(DateUtils.getNowDate()));
|
// 调用 Mapper 方法进行批量更新
|
||||||
return repairAuditDetailsMapper.updateRepairAuditDetailsBatch(repairAuditDetails);
|
return repairAuditDetailsMapper.updateRepairAuditDetailsBatch(ids,repairAuditDetails.get(0).getStatus());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new ServiceException("错误信息描述");
|
throw new ServiceException("错误信息描述");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -476,7 +476,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<update id="updateRepairAuditDetailsBatch">
|
<update id="updateRepairAuditDetailsBatch">
|
||||||
update repair_audit_details set status = #{status} where id in
|
update repair_audit_details
|
||||||
|
set status = #{status}, update_time = now()
|
||||||
|
where id in
|
||||||
<foreach item="id" index="index" collection="ids" open="(" separator="," close=")">
|
<foreach item="id" index="index" collection="ids" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue