功能优化

This commit is contained in:
mashuai 2025-08-30 22:42:04 +08:00
parent 7fc22fde25
commit 759f754fcf
24 changed files with 305 additions and 73 deletions

View File

@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.ToString; import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity; import com.bonus.common.core.web.domain.BaseEntity;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
@ -62,7 +63,7 @@ public class LeaseOutDetails extends BaseEntity {
private Integer outType; private Integer outType;
/** 预领料数 */ /** 预领料数 */
@Excel(name = "预领料数") @Excel(name = "预领料数", align = HorizontalAlignment.RIGHT)
@ApiModelProperty(value = "预领料数") @ApiModelProperty(value = "预领料数")
private BigDecimal outNum; private BigDecimal outNum;

View File

@ -191,4 +191,6 @@ public class RepairInputDetails extends BaseEntity {
@ApiModelProperty(value = "一级类型id") @ApiModelProperty(value = "一级类型id")
private String firstId; private String firstId;
private String backCode;
} }

View File

@ -1,5 +1,6 @@
package com.bonus.material.lease.mapper; package com.bonus.material.lease.mapper;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
import com.bonus.common.biz.domain.lease.LeaseApplyInfo; import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
@ -175,14 +176,14 @@ public interface LeaseApplyDetailsMapper {
* @param record * @param record
* @return * @return
*/ */
int updateLeaseApplyPublishDetailsOutNum(@Param("record") LeaseOutDetails record); int updateLeaseApplyPublishDetailsOutNum(LeaseApplyDetails record);
/** /**
* 获取领用任务详细 * 获取领用任务详细
* @param record * @param record
* @return * @return
*/ */
LeaseApplyDetails getLeasePublishApplyDetails(@Param("record") LeaseOutDetails record); List<LeaseApplyDetails> getLeasePublishApplyDetails(@Param("record") LeaseOutDetails record);
/** /**
* 查询数量设备待出库详情 * 查询数量设备待出库详情
@ -197,4 +198,25 @@ public interface LeaseApplyDetailsMapper {
* @return * @return
*/ */
LeaseApplyDetails getPendingCodeLeaseApplyDetails(LeaseOutDetails leaseOutDetails); LeaseApplyDetails getPendingCodeLeaseApplyDetails(LeaseOutDetails leaseOutDetails);
/**
* 查询待出库详情
* @param detail
* @return
*/
BigDecimal getOutNum(LeaseApplyDetails detail);
/**
* 获取领用任务
* @param record
* @return
*/
LeaseApplyDetails getLeasePublishApply(LeaseOutDetails record);
/**
* 修改领用任务详细
* @param bean
* @return
*/
int updateLeaseApplyPublishDetails(LeaseApplyDetails bean);
} }

View File

@ -192,10 +192,10 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
// 步骤8: 获取领料单详情 // 步骤8: 获取领料单详情
long step8Start = System.currentTimeMillis(); long step8Start = System.currentTimeMillis();
List<LeaseApplyDetails> details; List<LeaseApplyDetails> details;
if (leaseApplyInfo.getUserId() != null) { if (!CollectionUtils.isEmpty(typeIdList)) {
details = leaseApplyDetailsMapper.selectLeaseApplyDetailsList(new LeaseApplyDetails(info.getId(), keyword, userId, null));
} else {
details = leaseApplyDetailsMapper.selectLeaseApplyDetailsList(new LeaseApplyDetails(info.getId(), keyword, null, typeIdList)); details = leaseApplyDetailsMapper.selectLeaseApplyDetailsList(new LeaseApplyDetails(info.getId(), keyword, null, typeIdList));
} else {
details = leaseApplyDetailsMapper.selectLeaseApplyDetailsList(new LeaseApplyDetails(info.getId(), keyword, userId, null));
} }
stepTimes.put("获取领料单详情", System.currentTimeMillis() - step8Start); stepTimes.put("获取领料单详情", System.currentTimeMillis() - step8Start);
@ -207,6 +207,10 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
details = leaseApplyDetailsMapper.getDetailsPublish(leaseApplyInfo); details = leaseApplyDetailsMapper.getDetailsPublish(leaseApplyInfo);
if (!CollectionUtils.isEmpty(details)) { if (!CollectionUtils.isEmpty(details)) {
for (LeaseApplyDetails detail : details) { for (LeaseApplyDetails detail : details) {
// 根据parent_id和type_id查询出库数量
BigDecimal outNum = leaseApplyDetailsMapper.getOutNum(detail);
detail.setAlNum(outNum);
detail.setOutNum(detail.getPreNum().subtract(outNum));
if (detail.getPreNum().compareTo(detail.getAlNum()) == 0) { if (detail.getPreNum().compareTo(detail.getAlNum()) == 0) {
detail.setStatus("2"); detail.setStatus("2");
} else { } else {

View File

@ -16,6 +16,7 @@ import com.bonus.common.core.utils.DateUtils;
import com.bonus.common.core.utils.StringUtils; import com.bonus.common.core.utils.StringUtils;
import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.security.utils.SecurityUtils; import com.bonus.common.security.utils.SecurityUtils;
import com.bonus.material.back.mapper.BackApplyInfoMapper;
import com.bonus.material.basic.domain.BmAgreementInfo; import com.bonus.material.basic.domain.BmAgreementInfo;
import com.bonus.material.basic.domain.BmQrBoxInfo; import com.bonus.material.basic.domain.BmQrBoxInfo;
import com.bonus.material.basic.domain.BmUnit; import com.bonus.material.basic.domain.BmUnit;
@ -101,6 +102,9 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
@Resource @Resource
private MaterialLeaseInfoMapper materialLeaseInfoMapper; private MaterialLeaseInfoMapper materialLeaseInfoMapper;
@Resource
private BackApplyInfoMapper backApplyInfoMapper;
/** /**
* 查询领料出库详细 * 查询领料出库详细
* *
@ -190,9 +194,9 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
int res; int res;
try { try {
// 1判断库存是否足够 // 1判断库存是否足够
boolean isEnough = checkStorageIsEnough(record); //boolean isEnough = checkStorageIsEnough(record);
record.setPreStoreNum(getStorageNum(record)); record.setPreStoreNum(getStorageNum(record));
if (isEnough) { /*if (isEnough) {*/
if ((record.getManageType().equals(MaTypeManageTypeEnum.NUMBER_DEVICE.getTypeId())) && record.getInputNum() != null) { if ((record.getManageType().equals(MaTypeManageTypeEnum.NUMBER_DEVICE.getTypeId())) && record.getInputNum() != null) {
record.setOutNum(record.getInputNum()); record.setOutNum(record.getInputNum());
record.setOutType(InputOutEnum.NUMBER_DEVICE.getTypeId()); record.setOutType(InputOutEnum.NUMBER_DEVICE.getTypeId());
@ -395,9 +399,9 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
} else { } else {
return AjaxResult.error("领料出库失败,机具库存不足"); return AjaxResult.error("领料出库失败,机具库存不足");
} }
} else { /*} else {
return AjaxResult.error("已领数量大于预领数量或该机具未在库"); return AjaxResult.error("已领数量大于预领数量或该机具未在库");
} }*/
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage()); log.error(e.getMessage());
return AjaxResult.error("出库失败" + e.getMessage()); return AjaxResult.error("出库失败" + e.getMessage());
@ -765,8 +769,28 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
// 首先更新领料任务详情表的领料数及状态lease_apply_details // 首先更新领料任务详情表的领料数及状态lease_apply_details
if (StringUtils.isNotBlank(record.getPublishTask())) { if (StringUtils.isNotBlank(record.getPublishTask())) {
// 领用 // 领用
res = leaseApplyDetailsMapper.updateLeaseApplyPublishDetailsOutNum(record); List<LeaseApplyDetails> allList = leaseApplyDetailsMapper.getLeasePublishApplyDetails(record);
leaseApplyDetails = leaseApplyDetailsMapper.getLeasePublishApplyDetails(record); // 出库数量
BigDecimal outNum = record.getOutNum();
if (!CollectionUtils.isEmpty(allList)) {
for (LeaseApplyDetails bean : allList) {
bean.setAlNum(outNum);
// 剩余出库数量
BigDecimal num = bean.getOutNum();
if (outNum.compareTo(num) == 0) {
res = leaseApplyDetailsMapper.updateLeaseApplyPublishDetailsOutNum(bean);
break;
} else if (outNum.compareTo(num) > 0) {
outNum = outNum.subtract(num);
bean.setAlNum(bean.getOutNum());
leaseApplyDetailsMapper.updateLeaseApplyPublishDetailsOutNum(bean);
} else {
res = leaseApplyDetailsMapper.updateLeaseApplyPublishDetails(bean);
break;
}
}
}
leaseApplyDetails = leaseApplyDetailsMapper.getLeasePublishApply(record);
} else { } else {
// 领料办理 // 领料办理
res = leaseApplyDetailsMapper.updateLeaseApplyDetailsOutNum(record); res = leaseApplyDetailsMapper.updateLeaseApplyDetailsOutNum(record);

View File

@ -246,4 +246,7 @@ public class Type extends BaseEntity {
@ApiModelProperty(value = "是否检验0不检验1检验") @ApiModelProperty(value = "是否检验0不检验1检验")
private String isCheck; private String isCheck;
@ApiModelProperty("机具类型1机具2安全工器具")
private int jiJuType;
} }

View File

@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.ToString; import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity; import com.bonus.common.core.web.domain.BaseEntity;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
/** /**
* 机具类型历史库存对象 ma_type_num_his * 机具类型历史库存对象 ma_type_num_his
@ -26,7 +27,7 @@ public class TypeNumHis extends BaseEntity
private Long typeId; private Long typeId;
/** 历史库存 */ /** 历史库存 */
@Excel(name = "历史库存") @Excel(name = "历史库存", align = HorizontalAlignment.RIGHT)
@ApiModelProperty(value = "历史库存") @ApiModelProperty(value = "历史库存")
private Long storageNum; private Long storageNum;

View File

@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -69,7 +70,7 @@ public class StandardConfigDetailsVo {
private String unitName; private String unitName;
@ApiModelProperty(value = "数量") @ApiModelProperty(value = "数量")
@Excel(name = "数量") @Excel(name = "数量", align = HorizontalAlignment.RIGHT)
private BigDecimal num; private BigDecimal num;
@ApiModelProperty(value = "预领数量") @ApiModelProperty(value = "预领数量")

View File

@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.ToString; import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity; import com.bonus.common.core.web.domain.BaseEntity;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
/** /**
* 推送接收明细对象 push_data_receive_detail * 推送接收明细对象 push_data_receive_detail
@ -47,7 +48,7 @@ public class PushDataReceiveDetail extends BaseEntity {
private Date rentTime; private Date rentTime;
/** 租赁价格 */ /** 租赁价格 */
@Excel(name = "租赁价格") @Excel(name = "租赁价格", align = HorizontalAlignment.RIGHT)
@ApiModelProperty(value = "租赁价格") @ApiModelProperty(value = "租赁价格")
private BigDecimal rentPrice; private BigDecimal rentPrice;

View File

@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.ToString; import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity; import com.bonus.common.core.web.domain.BaseEntity;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
/** /**
* 推送接收对象 push_data_receive_info * 推送接收对象 push_data_receive_info
@ -30,7 +31,7 @@ public class PushDataReceiveInfo extends BaseEntity {
private Long receiveStatus; private Long receiveStatus;
/** 推送数量 */ /** 推送数量 */
@Excel(name = "推送数量") @Excel(name = "推送数量", align = HorizontalAlignment.RIGHT)
@ApiModelProperty(value = "推送数量") @ApiModelProperty(value = "推送数量")
private Long pushNum; private Long pushNum;

View File

@ -71,10 +71,10 @@ public interface RepairInputDetailsMapper {
/** /**
* 根据任务id查询状态 * 根据任务id查询状态
* @param taskId * @param repairInputDetails
* @return * @return
*/ */
List<String> selectStatusByTaskId(Long taskId); List<String> selectStatusByTaskId(RepairInputDetails repairInputDetails);
/** /**
* 修改库存数量 * 修改库存数量

View File

@ -153,6 +153,24 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
}) })
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
for (RepairInputDetails inputDetails : list) {
// 根据taskId和userId查询详情赋值最外层任务状态
inputDetails.setUserId(SecurityUtils.getLoginUser().getUserid());
List<String> taskStatusList = repairInputDetailsMapper.selectStatusByTaskId(inputDetails);
List<Integer> statusList = taskStatusList.stream().map(Integer::parseInt).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(statusList)) {
if (!statusList.contains(RepairInputStatusEnum.INPUT_TASK_NO_FINISHED.getStatus()) &&
statusList.contains(RepairInputStatusEnum.INPUT_TASK_TO_REJECT.getStatus())) {
inputDetails.setTaskStatus(RepairInputStatusEnum.INPUT_TASK_TO_REJECT.getStatus());
inputDetails.setStatusName(RepairInputStatusEnum.INPUT_TASK_TO_REJECT.getStatusName());
} else if (!statusList.contains(RepairInputStatusEnum.INPUT_TASK_NO_FINISHED.getStatus()) &&
!statusList.contains(RepairInputStatusEnum.INPUT_TASK_TO_REJECT.getStatus()) &&
statusList.stream().allMatch(status -> status.equals(RepairInputStatusEnum.INPUT_TASK_IN_FINISHED.getStatus()))) {
inputDetails.setTaskStatus(RepairInputStatusEnum.INPUT_TASK_IN_FINISHED.getStatus());
inputDetails.setStatusName(RepairInputStatusEnum.INPUT_TASK_IN_FINISHED.getStatusName());
}
}
}
} }
// if (CollectionUtils.isNotEmpty(list)) { // if (CollectionUtils.isNotEmpty(list)) {
// for (RepairInputDetails inputDetails : list) { // for (RepairInputDetails inputDetails : list) {
@ -186,6 +204,21 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
.filter(item -> containsKeyword(item, keyWord)) .filter(item -> containsKeyword(item, keyWord))
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
if (repairInputDetails.getTaskStatus() != null) {
list = list.stream()
.filter(item -> item.getTaskStatus().equals(repairInputDetails.getTaskStatus()))
.collect(Collectors.toList());
}
if (repairInputDetails.getAppTaskStatus() != null && repairInputDetails.getAppTaskStatus() == 0) {
list = list.stream()
.filter(item -> item.getTaskStatus().equals(repairInputDetails.getAppTaskStatus()))
.collect(Collectors.toList());
}
if (repairInputDetails.getAppTaskStatus() != null && repairInputDetails.getAppTaskStatus() == 1) {
list = list.stream()
.filter(item -> item.getTaskStatus() == 1 || item.getTaskStatus() == 2)
.collect(Collectors.toList());
}
return list; return list;
} }
@ -691,7 +724,7 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
* @param repairInputDetails * @param repairInputDetails
*/ */
private void updateTaskStatus(RepairInputDetails repairInputDetails) { private void updateTaskStatus(RepairInputDetails repairInputDetails) {
List<String> list = repairInputDetailsMapper.selectStatusByTaskId(repairInputDetails.getTaskId()); List<String> list = repairInputDetailsMapper.selectStatusByTaskId(repairInputDetails);
List<Integer> statusList = list.stream().map(Integer::parseInt).collect(Collectors.toList()); List<Integer> statusList = list.stream().map(Integer::parseInt).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(statusList)) { if (CollectionUtils.isNotEmpty(statusList)) {
if (!statusList.contains(RepairInputStatusEnum.INPUT_TASK_NO_FINISHED.getStatus()) && if (!statusList.contains(RepairInputStatusEnum.INPUT_TASK_NO_FINISHED.getStatus()) &&

View File

@ -4,9 +4,9 @@ import com.bonus.common.core.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List;
/** /**
* 报废台账返回实体类 * 报废台账返回实体类
@ -32,12 +32,12 @@ public class ScrapDetailsListVo {
private String unitName; private String unitName;
/** 报废数量 */ /** 报废数量 */
@Excel(name = "报废数量") @Excel(name = "报废数量", align = HorizontalAlignment.RIGHT)
@ApiModelProperty(value = "报废数量") @ApiModelProperty(value = "报废数量")
private BigDecimal scrapNum; private BigDecimal scrapNum;
@ApiModelProperty(value = "费用合计") @ApiModelProperty(value = "费用合计")
@Excel(name = "报废费用(万元)") @Excel(name = "报废费用(万元)", align = HorizontalAlignment.RIGHT)
private BigDecimal totalCost; private BigDecimal totalCost;
@ApiModelProperty(value = "购置价") @ApiModelProperty(value = "购置价")

View File

@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.ToString; import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity; import com.bonus.common.core.web.domain.BaseEntity;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
/** /**
* 结算协议申请对象 slt_agreement_apply * 结算协议申请对象 slt_agreement_apply
@ -68,7 +69,7 @@ public class SltAgreementApply extends BaseEntity {
private Long companyId; private Long companyId;
/** 结算总费用 */ /** 结算总费用 */
@Excel(name = "结算总费用") @Excel(name = "结算总费用", align = HorizontalAlignment.RIGHT)
@ApiModelProperty(value = "结算总费用") @ApiModelProperty(value = "结算总费用")
private BigDecimal cost; private BigDecimal cost;

View File

@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.ToString; import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity; import com.bonus.common.core.web.domain.BaseEntity;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
/** /**
* 结算协议详情对象 slt_agreement_details * 结算协议详情对象 slt_agreement_details
@ -46,7 +47,7 @@ public class SltAgreementDetails extends BaseEntity {
private String sltType; private String sltType;
/** 数量 */ /** 数量 */
@Excel(name = "数量") @Excel(name = "数量", align = HorizontalAlignment.RIGHT)
@ApiModelProperty(value = "数量") @ApiModelProperty(value = "数量")
private Long num; private Long num;
@ -63,12 +64,12 @@ public class SltAgreementDetails extends BaseEntity {
private Date endTime; private Date endTime;
/** 单价 */ /** 单价 */
@Excel(name = "单价") @Excel(name = "单价", align = HorizontalAlignment.RIGHT)
@ApiModelProperty(value = "单价") @ApiModelProperty(value = "单价")
private BigDecimal price; private BigDecimal price;
/** 金额 */ /** 金额 */
@Excel(name = "金额") @Excel(name = "金额", align = HorizontalAlignment.RIGHT)
@ApiModelProperty(value = "金额") @ApiModelProperty(value = "金额")
private BigDecimal money; private BigDecimal money;

View File

@ -41,6 +41,36 @@ public class UseMaintenanceWarningController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
/**
* 查询检修过期列表
* @param bean
* @return
*/
@ApiOperation(value = "查询检修过期列表")
@GetMapping("/getOverTimeList")
public TableDataInfo getOverTimeList(UseMaintenanceWarningBean bean)
{
startPage();
List<UseMaintenanceWarningBean> list = service.getOverTimeListList(bean);
return getDataTable(list);
}
/**
* 导出检修过期列表
* @param response
* @param bean
*/
@ApiOperation(value = "导出检修过期列表")
@PreventRepeatSubmit
@SysLog(title = "检修预警", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出检修过期列表")
@PostMapping("/exportOverTimeList")
public void exportOverTimeList(HttpServletResponse response, UseMaintenanceWarningBean bean)
{
List<UseMaintenanceWarningBean> list = service.getOverTimeListList(bean);
ExcelUtil<UseMaintenanceWarningBean> util = new ExcelUtil<UseMaintenanceWarningBean>(UseMaintenanceWarningBean.class);
util.exportExcel(response, list, "检修过期数据");
}
/** /**
* 导出 * 导出
*/ */

View File

@ -31,4 +31,11 @@ public interface UseMaintenanceWarningMapper
List<UseMaintenanceWarningBean> getWarningLastDayList(UseMaintenanceWarningBean useMaintenanceWarningBean); List<UseMaintenanceWarningBean> getWarningLastDayList(UseMaintenanceWarningBean useMaintenanceWarningBean);
List<UseMaintenanceWarningBean> getUserManger(UseMaintenanceWarningBean bean); List<UseMaintenanceWarningBean> getUserManger(UseMaintenanceWarningBean bean);
/**
* 查询检修过期列表
* @param bean
* @return
*/
List<UseMaintenanceWarningBean> getOverTimeListList(UseMaintenanceWarningBean bean);
} }

View File

@ -19,4 +19,10 @@ public interface UseMaintenanceWarningService
*/ */
public List<UseMaintenanceWarningBean> getList(UseMaintenanceWarningBean bean); public List<UseMaintenanceWarningBean> getList(UseMaintenanceWarningBean bean);
/**
* 查询检修过期列表
* @param bean
* @return
*/
List<UseMaintenanceWarningBean> getOverTimeListList(UseMaintenanceWarningBean bean);
} }

View File

@ -37,4 +37,19 @@ public class UseMaintenanceWarningServiceImpl implements UseMaintenanceWarningSe
} }
} }
/**
* 查询检修过期列表
* @param bean
* @return
*/
@Override
public List<UseMaintenanceWarningBean> getOverTimeListList(UseMaintenanceWarningBean bean) {
try {
return mapper.getOverTimeListList(bean);
} catch (Exception e) {
e.printStackTrace();
return new ArrayList<>();
}
}
} }

View File

@ -289,14 +289,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
UPDATE UPDATE
lease_apply_details lease_apply_details
SET SET
al_num = IF(al_num IS NULL, #{record.outNum}, al_num + #{record.outNum}), al_num = IF(al_num IS NULL, #{alNum}, al_num + #{alNum}),
<if test="record.updateBy != null and record.updateBy!= '' "> update_time = now(),
update_by = #{record.updateBy}, status = '2'
</if> WHERE
id = #{id}
</update>
<update id="updateLeaseApplyPublishDetails">
UPDATE
lease_apply_details
SET
al_num = IF(al_num IS NULL, #{alNum}, al_num + #{alNum}),
update_time = now(), update_time = now(),
status = '1' status = '1'
WHERE WHERE
parent_id = #{record.parentId} and new_type = #{record.typeId} id = #{id}
</update> </update>
<select id="getOutboundNum" resultType="com.bonus.material.lease.domain.LeaseApplyDetails"> <select id="getOutboundNum" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">
@ -523,16 +531,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getDetailsPublish" resultType="com.bonus.material.lease.domain.LeaseApplyDetails"> <select id="getDetailsPublish" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">
SELECT SELECT
a.id AS id,
lpd.parent_id AS parentId, lpd.parent_id AS parentId,
mt1.type_name AS maTypeName, mt1.type_name AS maTypeName,
mt.type_name AS typeName, mt.type_name AS typeName,
mt.unit_name AS unitName, mt.unit_name AS unitName,
lpd.new_type AS newTypeId, lpd.new_type AS newTypeId,
COALESCE(lpd.new_type, lpd.type_id) AS typeId, COALESCE(lpd.new_type, lpd.type_id) AS typeId,
IFNULL( lpd.num, 0 ) AS preNum, IFNULL( sum(lpd.num), 0 ) AS preNum,
IFNULL( lpd.num, 0 ) - IFNULL( SUM( lod.out_num ), 0 ) AS outNum,
IFNULL( SUM( lod.out_num ), 0 ) AS alNum,
lpd.publish_task AS publishTask, lpd.publish_task AS publishTask,
mt.manage_type AS manageType, mt.manage_type AS manageType,
CASE mt.manage_type CASE mt.manage_type
@ -563,10 +568,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE mm.ma_code is not null WHERE mm.ma_code is not null
and mm.ma_status in (1) and mm.ma_status in (1)
GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = mt.type_id GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = mt.type_id
LEFT JOIN lease_out_details lod ON lpd.new_type = lod.type_id
AND lpd.publish_task = lod.publish_task
LEFT JOIN (SELECT id, parent_id, type_id from lease_apply_details GROUP BY parent_id, type_id) a
on lpd.parent_id = a.parent_id and a.type_id = lpd.type_id
<if test="userId != null"> <if test="userId != null">
JOIN ma_type_keeper mtk ON mtk.type_id = lpd.new_type AND mtk.user_id = #{userId} JOIN ma_type_keeper mtk ON mtk.type_id = lpd.new_type AND mtk.user_id = #{userId}
</if> </if>
@ -664,9 +665,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getLeasePublishApplyDetails" resultType="com.bonus.material.lease.domain.LeaseApplyDetails"> <select id="getLeasePublishApplyDetails" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">
SELECT SELECT
ifnull( pre_num, 0 ) AS preNum, id AS id,
ifnull( audit_num, 0 ) AS auditNum, IFNULL( pre_num, 0 ) AS preNum,
ifnull( al_num, 0 ) AS alNum IFNULL( audit_num, 0 ) AS auditNum,
IFNULL( al_num, 0 ) AS alNum,
IFNULL( pre_num, 0 ) - IFNULL( al_num, 0 ) AS outNum
FROM FROM
lease_apply_details lease_apply_details
WHERE WHERE
@ -699,4 +702,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
parent_id = #{parentId} and COALESCE(new_type, type_id) = #{typeId} parent_id = #{parentId} and COALESCE(new_type, type_id) = #{typeId}
</select> </select>
<select id="getOutNum" resultType="java.math.BigDecimal">
SELECT
IFNULL(SUM(out_num),0)
FROM
lease_out_details
WHERE
parent_id = #{parentId}
AND type_id = #{typeId}
</select>
<select id="getLeasePublishApply" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">
SELECT
ifnull( sum( pre_num ), 0 ) AS preNum,
ifnull( sum( audit_num ), 0 ) AS auditNum,
ifnull( sum( al_num ), 0 ) AS alNum
FROM
lease_apply_details
WHERE
parent_id = #{parentId}
AND new_type = #{typeId}
</select>
</mapper> </mapper>

View File

@ -319,7 +319,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT SELECT
lai.id AS id, lai.id AS id,
lpd.code AS code, lpd.code AS code,
lai.code AS businessCode, tt.code AS businessCode,
lai.create_by AS createBy, lai.create_by AS createBy,
lai.create_time AS createTime, lai.create_time AS createTime,
sd.dept_name AS impUnitName, sd.dept_name AS impUnitName,
@ -654,7 +654,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT SELECT
GROUP_CONCAT( DISTINCT lod.id ) AS ids, GROUP_CONCAT( DISTINCT lod.id ) AS ids,
lai.id AS id, lai.id AS id,
lai.CODE AS CODE, tt.CODE AS CODE,
lai.create_by AS createBy, lai.create_by AS createBy,
lai.create_time AS createTime, lai.create_time AS createTime,
lai.lease_person AS leasePerson, lai.lease_person AS leasePerson,

View File

@ -818,7 +818,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update> </update>
<select id="selectByTypeId" resultType="com.bonus.material.ma.domain.Type"> <select id="selectByTypeId" resultType="com.bonus.material.ma.domain.Type">
select * from ma_type WHERE select
type_id as typeId,
type_name as typeName,
parent_id as parentId,
storage_num as storageNum,
manage_type as manageType,
unit_name as unitName,
jiju_type as jijuType,
is_check as isCheck
from ma_type
WHERE
type_id = #{record.typeId} type_id = #{record.typeId}
</select> </select>

View File

@ -32,6 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT SELECT
rd.task_id AS taskId, rd.task_id AS taskId,
tt1.CODE AS repairCode, tt1.CODE AS repairCode,
null AS backCode,
rd.create_time AS createTime, rd.create_time AS createTime,
tt.task_status AS taskStatus, tt.task_status AS taskStatus,
CASE tt.task_status CASE tt.task_status
@ -71,15 +72,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inputCode != null and inputCode != ''"> <if test="inputCode != null and inputCode != ''">
AND tt.CODE = #{inputCode} AND tt.CODE = #{inputCode}
</if> </if>
<if test="taskStatus != null ">
AND tt.task_status = #{taskStatus}
</if>
<if test="appTaskStatus != null and appTaskStatus == 0">
and tt.task_status = #{appTaskStatus}
</if>
<if test="appTaskStatus != null and appTaskStatus == 1">
and (tt.task_status = 1 or tt.task_status = 2)
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
<![CDATA[and DATE_FORMAT( rd.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]> <![CDATA[and DATE_FORMAT( rd.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
</if> </if>
@ -91,6 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT SELECT
rd.task_id AS taskId, rd.task_id AS taskId,
tt1.CODE AS repairCode, tt1.CODE AS repairCode,
bai.`code` AS backCode,
rd.create_time AS createTime, rd.create_time AS createTime,
tt.task_status AS taskStatus, tt.task_status AS taskStatus,
CASE tt.task_status CASE tt.task_status
@ -114,7 +107,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN ma_type mt on rd.type_id = mt.type_id LEFT JOIN ma_type mt on rd.type_id = mt.type_id
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
LEFT JOIN tm_task tt on rd.task_id = tt.task_id LEFT JOIN tm_task tt on rd.task_id = tt.task_id
LEFT JOIN repair_apply_details rad ON rad.task_id = rd.repair_id LEFT JOIN repair_apply_details rad ON rad.id = rd.repair_id
LEFT JOIN back_apply_info bai ON rad.back_id = bai.id
LEFT JOIN tm_task tt1 on rad.task_id = tt1.task_id LEFT JOIN tm_task tt1 on rad.task_id = tt1.task_id
LEFT JOIN tm_task_agreement tta ON rd.task_id = tta.task_id LEFT JOIN tm_task_agreement tta ON rd.task_id = tta.task_id
LEFT JOIN bm_agreement_info bai2 ON tta.agreement_id = bai2.agreement_id LEFT JOIN bm_agreement_info bai2 ON tta.agreement_id = bai2.agreement_id
@ -127,19 +121,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
JOIN ma_type_keeper mtr ON mtr.type_id = rd.type_id AND mtr.user_id = #{userId} JOIN ma_type_keeper mtr ON mtr.type_id = rd.type_id AND mtr.user_id = #{userId}
</if> </if>
<where> <where>
rd.create_time &gt;= '2025-08-20 00:00:00' rad.create_time &gt;= '2025-08-20 00:00:00'
<if test="inputCode != null and inputCode != ''"> <if test="inputCode != null and inputCode != ''">
AND tt.CODE = #{inputCode} AND tt.CODE = #{inputCode}
</if> </if>
<if test="taskStatus != null ">
AND tt.task_status = #{taskStatus}
</if>
<if test="appTaskStatus != null and appTaskStatus == 0">
and tt.task_status = #{appTaskStatus}
</if>
<if test="appTaskStatus != null and appTaskStatus == 1">
and (tt.task_status = 1 or tt.task_status = 2)
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
<![CDATA[and DATE_FORMAT( rd.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]> <![CDATA[and DATE_FORMAT( rd.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
</if> </if>
@ -198,7 +183,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="selectStatusByTaskId" resultType="java.lang.String"> <select id="selectStatusByTaskId" resultType="java.lang.String">
select status from repair_input_details where task_id = #{taskId} select rd.status from repair_input_details rd
<if test="userId != null">
JOIN ma_type_keeper mtr ON mtr.type_id = rd.type_id AND mtr.user_id = #{userId}
</if>
where task_id = #{taskId}
</select> </select>
<select id="getCodeList" resultType="com.bonus.material.back.domain.vo.MaCodeVo"> <select id="getCodeList" resultType="com.bonus.material.back.domain.vo.MaCodeVo">

View File

@ -199,4 +199,59 @@
LEFT JOIN sys_user_role sr on su.user_id = sr.user_id LEFT JOIN sys_user_role sr on su.user_id = sr.user_id
WHERE sr.role_id in (59,81) and dept_id =#{deptId} WHERE sr.role_id in (59,81) and dept_id =#{deptId}
</select> </select>
<select id="getOverTimeListList" resultType="com.bonus.material.warningAnalysis.domain.UseMaintenanceWarningBean">
SELECT
mm.ma_id as maId,
mm.next_check_time as nextCheckTime,
mt3.type_name as materialType,
mt2.type_name as typeName,
mt.type_name as typeModelName,
mm.ma_code as maCode,
bu.unit_name as unitName,
bp.pro_name as projectName,
bai.agreement_code as agreementCode,
DATEDIFF(mm.next_check_time, CURDATE()) AS overDays,
sd.dept_name as impUnit
FROM
ma_machine mm
LEFT JOIN ma_type mt on mt.type_id=mm.type_id
LEFT JOIN ma_type mt2 on mt2.type_id=mt.parent_id
LEFT JOIN ma_type mt3 on mt3.type_id=mt2.parent_id
LEFT JOIN ma_type mt4 on mt4.type_id=mt3.parent_id
LEFT JOIN slt_agreement_info sai on sai.ma_id=mm.ma_id and mm.type_id=sai.type_id and sai.`status`='0' and
sai.end_time is null
LEFT JOIN bm_agreement_info bai on bai.agreement_id=sai.agreement_id
LEFT JOIN bm_unit bu ON bai.unit_id = bu.unit_id
AND bu.del_flag = '0'
LEFT JOIN bm_project bp ON bai.project_id = bp.pro_id
AND bp.del_flag = '0'
LEFT JOIN sys_dept sd on sd.dept_id = bp.imp_unit
WHERE
mm.ma_status='2' and sai.is_slt = 0
AND bp.pro_name is not null
AND mm.next_check_time &lt;= CURDATE()
<if test="keyWord != null and keyWord != ''">
and (
mt4.type_name like concat('%', #{keyWord}, '%') or
mt3.type_name like concat('%', #{keyWord}, '%') or
mt2.type_name like concat('%', #{keyWord}, '%') or
mt.type_name like concat('%', #{keyWord}, '%') or
mm.ma_code like concat('%', #{keyWord}, '%') or
bu.unit_name like concat('%', #{keyWord}, '%') or
bp.pro_name like concat('%', #{keyWord}, '%') or
bai.agreement_code like concat('%', #{keyWord}, '%')
)
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( mm.next_check_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<if test="typeId != null">
AND mt.type_id = #{typeId}
</if>
<if test="thirdTypeId != null">
AND mt2.type_id = #{thirdTypeId}
</if>
ORDER BY mm.next_check_time ASC
</select>
</mapper> </mapper>