功能优化
This commit is contained in:
parent
7fc22fde25
commit
759f754fcf
|
|
@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
|
@ -62,7 +63,7 @@ public class LeaseOutDetails extends BaseEntity {
|
|||
private Integer outType;
|
||||
|
||||
/** 预领料数 */
|
||||
@Excel(name = "预领料数")
|
||||
@Excel(name = "预领料数", align = HorizontalAlignment.RIGHT)
|
||||
@ApiModelProperty(value = "预领料数")
|
||||
private BigDecimal outNum;
|
||||
|
||||
|
|
|
|||
|
|
@ -191,4 +191,6 @@ public class RepairInputDetails extends BaseEntity {
|
|||
@ApiModelProperty(value = "一级类型id")
|
||||
private String firstId;
|
||||
|
||||
private String backCode;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.material.lease.mapper;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
|
||||
|
|
@ -175,14 +176,14 @@ public interface LeaseApplyDetailsMapper {
|
|||
* @param record
|
||||
* @return
|
||||
*/
|
||||
int updateLeaseApplyPublishDetailsOutNum(@Param("record") LeaseOutDetails record);
|
||||
int updateLeaseApplyPublishDetailsOutNum(LeaseApplyDetails record);
|
||||
|
||||
/**
|
||||
* 获取领用任务详细
|
||||
* @param record
|
||||
* @return
|
||||
*/
|
||||
LeaseApplyDetails getLeasePublishApplyDetails(@Param("record") LeaseOutDetails record);
|
||||
List<LeaseApplyDetails> getLeasePublishApplyDetails(@Param("record") LeaseOutDetails record);
|
||||
|
||||
/**
|
||||
* 查询数量设备待出库详情
|
||||
|
|
@ -197,4 +198,25 @@ public interface LeaseApplyDetailsMapper {
|
|||
* @return
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -192,10 +192,10 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
|||
// 步骤8: 获取领料单详情
|
||||
long step8Start = System.currentTimeMillis();
|
||||
List<LeaseApplyDetails> details;
|
||||
if (leaseApplyInfo.getUserId() != null) {
|
||||
details = leaseApplyDetailsMapper.selectLeaseApplyDetailsList(new LeaseApplyDetails(info.getId(), keyword, userId, null));
|
||||
} else {
|
||||
if (!CollectionUtils.isEmpty(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);
|
||||
|
||||
|
|
@ -207,6 +207,10 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
|||
details = leaseApplyDetailsMapper.getDetailsPublish(leaseApplyInfo);
|
||||
if (!CollectionUtils.isEmpty(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) {
|
||||
detail.setStatus("2");
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import com.bonus.common.core.utils.DateUtils;
|
|||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
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.BmQrBoxInfo;
|
||||
import com.bonus.material.basic.domain.BmUnit;
|
||||
|
|
@ -101,6 +102,9 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
|
|||
|
||||
@Resource
|
||||
private MaterialLeaseInfoMapper materialLeaseInfoMapper;
|
||||
|
||||
@Resource
|
||||
private BackApplyInfoMapper backApplyInfoMapper;
|
||||
/**
|
||||
* 查询领料出库详细
|
||||
*
|
||||
|
|
@ -190,9 +194,9 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
|
|||
int res;
|
||||
try {
|
||||
// 1、判断库存是否足够
|
||||
boolean isEnough = checkStorageIsEnough(record);
|
||||
//boolean isEnough = checkStorageIsEnough(record);
|
||||
record.setPreStoreNum(getStorageNum(record));
|
||||
if (isEnough) {
|
||||
/*if (isEnough) {*/
|
||||
if ((record.getManageType().equals(MaTypeManageTypeEnum.NUMBER_DEVICE.getTypeId())) && record.getInputNum() != null) {
|
||||
record.setOutNum(record.getInputNum());
|
||||
record.setOutType(InputOutEnum.NUMBER_DEVICE.getTypeId());
|
||||
|
|
@ -395,9 +399,9 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
|
|||
} else {
|
||||
return AjaxResult.error("领料出库失败,机具库存不足");
|
||||
}
|
||||
} else {
|
||||
/*} else {
|
||||
return AjaxResult.error("已领数量大于预领数量或该机具未在库");
|
||||
}
|
||||
}*/
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return AjaxResult.error("出库失败" + e.getMessage());
|
||||
|
|
@ -765,8 +769,28 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
|
|||
// 首先更新领料任务详情表的领料数及状态(lease_apply_details)
|
||||
if (StringUtils.isNotBlank(record.getPublishTask())) {
|
||||
// 领用
|
||||
res = leaseApplyDetailsMapper.updateLeaseApplyPublishDetailsOutNum(record);
|
||||
leaseApplyDetails = leaseApplyDetailsMapper.getLeasePublishApplyDetails(record);
|
||||
List<LeaseApplyDetails> allList = 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 {
|
||||
// 领料办理
|
||||
res = leaseApplyDetailsMapper.updateLeaseApplyDetailsOutNum(record);
|
||||
|
|
|
|||
|
|
@ -246,4 +246,7 @@ public class Type extends BaseEntity {
|
|||
@ApiModelProperty(value = "是否检验(0不检验,1检验)")
|
||||
private String isCheck;
|
||||
|
||||
@ApiModelProperty("机具类型(1机具,2安全工器具)")
|
||||
private int jiJuType;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
|
||||
/**
|
||||
* 机具类型历史库存对象 ma_type_num_his
|
||||
|
|
@ -26,7 +27,7 @@ public class TypeNumHis extends BaseEntity
|
|||
private Long typeId;
|
||||
|
||||
/** 历史库存 */
|
||||
@Excel(name = "历史库存")
|
||||
@Excel(name = "历史库存", align = HorizontalAlignment.RIGHT)
|
||||
@ApiModelProperty(value = "历史库存")
|
||||
private Long storageNum;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
|||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
|
@ -69,7 +70,7 @@ public class StandardConfigDetailsVo {
|
|||
private String unitName;
|
||||
|
||||
@ApiModelProperty(value = "数量")
|
||||
@Excel(name = "数量")
|
||||
@Excel(name = "数量", align = HorizontalAlignment.RIGHT)
|
||||
private BigDecimal num;
|
||||
|
||||
@ApiModelProperty(value = "预领数量")
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
|
||||
/**
|
||||
* 推送接收明细对象 push_data_receive_detail
|
||||
|
|
@ -47,7 +48,7 @@ public class PushDataReceiveDetail extends BaseEntity {
|
|||
private Date rentTime;
|
||||
|
||||
/** 租赁价格 */
|
||||
@Excel(name = "租赁价格")
|
||||
@Excel(name = "租赁价格", align = HorizontalAlignment.RIGHT)
|
||||
@ApiModelProperty(value = "租赁价格")
|
||||
private BigDecimal rentPrice;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
|
||||
/**
|
||||
* 推送接收对象 push_data_receive_info
|
||||
|
|
@ -30,7 +31,7 @@ public class PushDataReceiveInfo extends BaseEntity {
|
|||
private Long receiveStatus;
|
||||
|
||||
/** 推送数量 */
|
||||
@Excel(name = "推送数量")
|
||||
@Excel(name = "推送数量", align = HorizontalAlignment.RIGHT)
|
||||
@ApiModelProperty(value = "推送数量")
|
||||
private Long pushNum;
|
||||
|
||||
|
|
|
|||
|
|
@ -71,10 +71,10 @@ public interface RepairInputDetailsMapper {
|
|||
|
||||
/**
|
||||
* 根据任务id查询状态
|
||||
* @param taskId
|
||||
* @param repairInputDetails
|
||||
* @return
|
||||
*/
|
||||
List<String> selectStatusByTaskId(Long taskId);
|
||||
List<String> selectStatusByTaskId(RepairInputDetails repairInputDetails);
|
||||
|
||||
/**
|
||||
* 修改库存数量
|
||||
|
|
|
|||
|
|
@ -153,6 +153,24 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
|
|||
})
|
||||
.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)) {
|
||||
// for (RepairInputDetails inputDetails : list) {
|
||||
|
|
@ -181,11 +199,26 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
|
|||
// }
|
||||
String keyWord = repairInputDetails.getKeyWord();
|
||||
// 如果关键字不为空,进行过滤
|
||||
if (!StringUtils.isBlank(keyWord)) {
|
||||
list = list.stream()
|
||||
.filter(item -> containsKeyword(item, keyWord))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
if (!StringUtils.isBlank(keyWord)) {
|
||||
list = list.stream()
|
||||
.filter(item -> containsKeyword(item, keyWord))
|
||||
.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;
|
||||
}
|
||||
|
||||
|
|
@ -691,7 +724,7 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
|
|||
* @param 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());
|
||||
if (CollectionUtils.isNotEmpty(statusList)) {
|
||||
if (!statusList.contains(RepairInputStatusEnum.INPUT_TASK_NO_FINISHED.getStatus()) &&
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ import com.bonus.common.core.annotation.Excel;
|
|||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 报废台账返回实体类
|
||||
|
|
@ -32,12 +32,12 @@ public class ScrapDetailsListVo {
|
|||
private String unitName;
|
||||
|
||||
/** 报废数量 */
|
||||
@Excel(name = "报废数量")
|
||||
@Excel(name = "报废数量", align = HorizontalAlignment.RIGHT)
|
||||
@ApiModelProperty(value = "报废数量")
|
||||
private BigDecimal scrapNum;
|
||||
|
||||
@ApiModelProperty(value = "费用合计")
|
||||
@Excel(name = "报废费用(万元)")
|
||||
@Excel(name = "报废费用(万元)", align = HorizontalAlignment.RIGHT)
|
||||
private BigDecimal totalCost;
|
||||
|
||||
@ApiModelProperty(value = "购置价")
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
|
||||
/**
|
||||
* 结算协议申请对象 slt_agreement_apply
|
||||
|
|
@ -68,7 +69,7 @@ public class SltAgreementApply extends BaseEntity {
|
|||
private Long companyId;
|
||||
|
||||
/** 结算总费用 */
|
||||
@Excel(name = "结算总费用")
|
||||
@Excel(name = "结算总费用", align = HorizontalAlignment.RIGHT)
|
||||
@ApiModelProperty(value = "结算总费用")
|
||||
private BigDecimal cost;
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
|
||||
/**
|
||||
* 结算协议详情对象 slt_agreement_details
|
||||
|
|
@ -46,7 +47,7 @@ public class SltAgreementDetails extends BaseEntity {
|
|||
private String sltType;
|
||||
|
||||
/** 数量 */
|
||||
@Excel(name = "数量")
|
||||
@Excel(name = "数量", align = HorizontalAlignment.RIGHT)
|
||||
@ApiModelProperty(value = "数量")
|
||||
private Long num;
|
||||
|
||||
|
|
@ -63,12 +64,12 @@ public class SltAgreementDetails extends BaseEntity {
|
|||
private Date endTime;
|
||||
|
||||
/** 单价 */
|
||||
@Excel(name = "单价")
|
||||
@Excel(name = "单价", align = HorizontalAlignment.RIGHT)
|
||||
@ApiModelProperty(value = "单价")
|
||||
private BigDecimal price;
|
||||
|
||||
/** 金额 */
|
||||
@Excel(name = "金额")
|
||||
@Excel(name = "金额", align = HorizontalAlignment.RIGHT)
|
||||
@ApiModelProperty(value = "金额")
|
||||
private BigDecimal money;
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,36 @@ public class UseMaintenanceWarningController extends BaseController
|
|||
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, "检修过期数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -31,4 +31,11 @@ public interface UseMaintenanceWarningMapper
|
|||
List<UseMaintenanceWarningBean> getWarningLastDayList(UseMaintenanceWarningBean useMaintenanceWarningBean);
|
||||
|
||||
List<UseMaintenanceWarningBean> getUserManger(UseMaintenanceWarningBean bean);
|
||||
|
||||
/**
|
||||
* 查询检修过期列表
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<UseMaintenanceWarningBean> getOverTimeListList(UseMaintenanceWarningBean bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,4 +19,10 @@ public interface UseMaintenanceWarningService
|
|||
*/
|
||||
public List<UseMaintenanceWarningBean> getList(UseMaintenanceWarningBean bean);
|
||||
|
||||
/**
|
||||
* 查询检修过期列表
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<UseMaintenanceWarningBean> getOverTimeListList(UseMaintenanceWarningBean bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<>();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -289,14 +289,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
UPDATE
|
||||
lease_apply_details
|
||||
SET
|
||||
al_num = IF(al_num IS NULL, #{record.outNum}, al_num + #{record.outNum}),
|
||||
<if test="record.updateBy != null and record.updateBy!= '' ">
|
||||
update_by = #{record.updateBy},
|
||||
</if>
|
||||
al_num = IF(al_num IS NULL, #{alNum}, al_num + #{alNum}),
|
||||
update_time = now(),
|
||||
status = '1'
|
||||
status = '2'
|
||||
WHERE
|
||||
parent_id = #{record.parentId} and new_type = #{record.typeId}
|
||||
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(),
|
||||
status = '1'
|
||||
WHERE
|
||||
id = #{id}
|
||||
</update>
|
||||
|
||||
<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
|
||||
a.id AS id,
|
||||
lpd.parent_id AS parentId,
|
||||
mt1.type_name AS maTypeName,
|
||||
mt.type_name AS typeName,
|
||||
mt.unit_name AS unitName,
|
||||
lpd.new_type AS newTypeId,
|
||||
COALESCE(lpd.new_type, lpd.type_id) AS typeId,
|
||||
IFNULL( 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,
|
||||
IFNULL( sum(lpd.num), 0 ) AS preNum,
|
||||
lpd.publish_task AS publishTask,
|
||||
mt.manage_type AS manageType,
|
||||
CASE mt.manage_type
|
||||
|
|
@ -563,10 +568,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE mm.ma_code is not null
|
||||
and mm.ma_status in (1)
|
||||
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">
|
||||
JOIN ma_type_keeper mtk ON mtk.type_id = lpd.new_type AND mtk.user_id = #{userId}
|
||||
</if>
|
||||
|
|
@ -664,9 +665,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="getLeasePublishApplyDetails" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">
|
||||
SELECT
|
||||
ifnull( pre_num, 0 ) AS preNum,
|
||||
ifnull( audit_num, 0 ) AS auditNum,
|
||||
ifnull( al_num, 0 ) AS alNum
|
||||
id AS id,
|
||||
IFNULL( pre_num, 0 ) AS preNum,
|
||||
IFNULL( audit_num, 0 ) AS auditNum,
|
||||
IFNULL( al_num, 0 ) AS alNum,
|
||||
IFNULL( pre_num, 0 ) - IFNULL( al_num, 0 ) AS outNum
|
||||
FROM
|
||||
lease_apply_details
|
||||
WHERE
|
||||
|
|
@ -699,4 +702,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
parent_id = #{parentId} and COALESCE(new_type, type_id) = #{typeId}
|
||||
</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>
|
||||
|
|
|
|||
|
|
@ -319,7 +319,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
SELECT
|
||||
lai.id AS id,
|
||||
lpd.code AS code,
|
||||
lai.code AS businessCode,
|
||||
tt.code AS businessCode,
|
||||
lai.create_by AS createBy,
|
||||
lai.create_time AS createTime,
|
||||
sd.dept_name AS impUnitName,
|
||||
|
|
@ -654,7 +654,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
SELECT
|
||||
GROUP_CONCAT( DISTINCT lod.id ) AS ids,
|
||||
lai.id AS id,
|
||||
lai.CODE AS CODE,
|
||||
tt.CODE AS CODE,
|
||||
lai.create_by AS createBy,
|
||||
lai.create_time AS createTime,
|
||||
lai.lease_person AS leasePerson,
|
||||
|
|
|
|||
|
|
@ -818,8 +818,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</update>
|
||||
|
||||
<select id="selectByTypeId" resultType="com.bonus.material.ma.domain.Type">
|
||||
select * from ma_type WHERE
|
||||
type_id = #{record.typeId}
|
||||
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}
|
||||
</select>
|
||||
|
||||
<select id="getMaType" resultType="com.bonus.material.ma.domain.Type">
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
SELECT
|
||||
rd.task_id AS taskId,
|
||||
tt1.CODE AS repairCode,
|
||||
null AS backCode,
|
||||
rd.create_time AS createTime,
|
||||
tt.task_status AS taskStatus,
|
||||
CASE tt.task_status
|
||||
|
|
@ -71,15 +72,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="inputCode != null and inputCode != ''">
|
||||
AND tt.CODE = #{inputCode}
|
||||
</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 != ''">
|
||||
<![CDATA[and DATE_FORMAT( rd.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
|
||||
</if>
|
||||
|
|
@ -91,6 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
SELECT
|
||||
rd.task_id AS taskId,
|
||||
tt1.CODE AS repairCode,
|
||||
bai.`code` AS backCode,
|
||||
rd.create_time AS createTime,
|
||||
tt.task_status AS taskStatus,
|
||||
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 mt2 on mt.parent_id = mt2.type_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_agreement tta ON rd.task_id = tta.task_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}
|
||||
</if>
|
||||
<where>
|
||||
rd.create_time >= '2025-08-20 00:00:00'
|
||||
rad.create_time >= '2025-08-20 00:00:00'
|
||||
<if test="inputCode != null and inputCode != ''">
|
||||
AND tt.CODE = #{inputCode}
|
||||
</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 != ''">
|
||||
<![CDATA[and DATE_FORMAT( rd.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
|
||||
</if>
|
||||
|
|
@ -198,7 +183,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<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 id="getCodeList" resultType="com.bonus.material.back.domain.vo.MaCodeVo">
|
||||
|
|
|
|||
|
|
@ -199,4 +199,59 @@
|
|||
LEFT JOIN sys_user_role sr on su.user_id = sr.user_id
|
||||
WHERE sr.role_id in (59,81) and dept_id =#{deptId}
|
||||
</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 <= 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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue