This commit is contained in:
hongchao 2025-11-12 17:42:00 +08:00
commit 8b3ffc8957
12 changed files with 651 additions and 63 deletions

View File

@ -224,21 +224,19 @@ public class MachineServiceImpl implements IMachineService
//查询ma_machine表安全工器具
list = machineMapper.getElectronicLabel(machine);
}
for (Machine dto : list){
Date nextCheckTime = dto.getNextCheckTime();
Date todayStart = new Date(); // 获取当前时间
// todayStart 设置为当天的开始时间00:00:00
todayStart = Date.from(todayStart.toInstant().atZone(ZoneId.systemDefault())
.withHour(0).withMinute(0).withSecond(0).withNano(0)
.toInstant());
if (nextCheckTime != null && nextCheckTime.before(todayStart)) {
type=1;
throw new RuntimeException("该工器具已临近下次检验时间,请及时退还至机具(物流)分公司!");
}
}
if (CollectionUtils.isNotEmpty(list)) {
for (Machine dto : list) {
Date nextCheckTime = dto.getNextCheckTime();
Date todayStart = new Date(); // 获取当前时间
// todayStart 设置为当天的开始时间00:00:00
todayStart = Date.from(todayStart.toInstant().atZone(ZoneId.systemDefault())
.withHour(0).withMinute(0).withSecond(0).withNano(0)
.toInstant());
if (nextCheckTime != null && nextCheckTime.before(todayStart)) {
type=1;
throw new RuntimeException("该工器具已临近下次检验时间,请及时退还至机具(物流)分公司!");
}
// 根据typeId查询信息
Machine info = machineMapper.selectHouse(dto);
if (info != null) {

View File

@ -1,18 +1,20 @@
package com.bonus.material.push.controller;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.convert.Convert;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.bonus.common.biz.config.ListPagingUtil;
import com.bonus.common.biz.utils.AesEncryptUtils;
import com.bonus.common.biz.utils.HttpHelper;
import com.bonus.common.biz.utils.StringHelper;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.ServletUtils;
import com.bonus.common.core.utils.poi.ExcelUtil;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.web.page.TableDataInfo;
import com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo;
import com.bonus.material.clz.domain.vo.lease.LeaseTotalInfo;
import com.bonus.material.push.domain.IwsCostPushBean;
import com.bonus.material.push.domain.vo.IwsCostPushExportVo;
import com.bonus.material.push.service.IwsCostPushService;
@ -25,7 +27,6 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
@ -55,10 +56,11 @@ public class IwsCostPushController extends BaseController {
*/
@ApiOperation("查询协议推送匹配列表--分页")
@GetMapping("/findAgreementPushMatchList")
public TableDataInfo findAgreementPushMatchList(IwsCostPushBean obj) {
startPage();
public AjaxResult findAgreementPushMatchList(IwsCostPushBean obj) {
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
List<IwsCostPushBean> list = iwsCostPushService.findAgreement(obj);
return getDataTable(list);
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
}
/**

View File

@ -144,7 +144,7 @@ public class IwsCostPushBean implements Serializable {
// 是否匹配
@Excel(name = "是否匹配", readConverterExp = "0=未匹配,1=已匹配", sort = 5)
private Byte isMatch = 0;
private Byte isMatch;
private String userName;

View File

@ -68,15 +68,21 @@ public class IwsCostPushServiceImpl implements IwsCostPushService {
public List<IwsCostPushBean> findAgreement(IwsCostPushBean o) {
List<IwsCostPushBean> pushBeanList = iwsCostPushMapper.findAgreement(o);
// 使用流式操作过滤掉null值并设置isMatch属性
return pushBeanList.stream()
.filter(Objects::nonNull)
.peek(bean -> {
if (StringUtils.isNotBlank(bean.getProjectId()) && StringUtils.isNotBlank(bean.getProjectCode())) {
bean.setIsMatch((byte) 1);
}
})
.collect(Collectors.toList());
pushBeanList.forEach(bean -> {
if (bean != null) {
if (StringUtils.isNotBlank(bean.getProjectId()) && StringUtils.isNotBlank(bean.getProjectCode())) {
bean.setIsMatch((byte) 1);
} else {
bean.setIsMatch((byte) 0);
}
}
});
if (o.getIsMatch() != null) {
pushBeanList = pushBeanList.stream().filter(bean -> bean.getIsMatch().equals(o.getIsMatch())).collect(Collectors.toList());
}
return pushBeanList;
}
/**

View File

@ -5,6 +5,7 @@ import com.bonus.common.biz.config.ListPagingUtil;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils;
import com.bonus.common.core.utils.ServletUtils;
import com.bonus.common.core.utils.bean.BeanUtils;
import com.bonus.common.core.utils.poi.ExcelUtil;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
@ -14,10 +15,13 @@ import com.bonus.common.log.enums.OperaType;
import com.bonus.common.security.annotation.RequiresPermissions;
import com.bonus.material.back.domain.BackApplyInfo;
import com.bonus.material.back.domain.vo.BackApplyVo;
import com.bonus.material.basic.domain.ProjUsingRecord;
import com.bonus.material.basic.domain.ProjUsingRecordExport;
import com.bonus.material.common.annotation.PreventRepeatSubmit;
import com.bonus.material.ma.domain.LabelBind;
import com.bonus.material.repair.domain.*;
import com.bonus.material.repair.domain.vo.*;
import com.bonus.material.repair.service.IRepairAuditDetailsService;
import com.bonus.material.repair.service.RepairService;
import com.bonus.system.api.domain.SysUser;
import com.fasterxml.jackson.core.JsonProcessingException;
@ -35,6 +39,8 @@ import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotNull;
import java.util.*;
import static com.bonus.common.biz.enums.TmTaskTypeEnum.TM_TASK_REPAIR_AUDIT;
/**
* @author syruan
*/
@ -46,6 +52,9 @@ public class RepairController extends BaseController {
@Resource
private RepairService service;
@Resource
private IRepairAuditDetailsService repairAuditDetailsService;
/**
* Jackson -- 避免反序列化漏洞
*/
@ -483,6 +492,26 @@ public class RepairController extends BaseController {
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
}
@PostMapping("/exportDetails")
@ApiOperation(value = "导出维修任务列表")
public void exportDetails(HttpServletResponse response, RepairTask bean) {
List<RepairTask> list = new ArrayList<>();
List<RepairDetailsExport> listExport = new ArrayList<>();
try {
list = service.getRepairQueryList(bean);
//将list复制到exportList
for (RepairTask repairTask : list) {
RepairDetailsExport repairDetailsExport = new RepairDetailsExport();
BeanUtils.copyProperties(repairTask, repairDetailsExport);
listExport.add(repairDetailsExport);
}
} catch (Exception e) {
list = new ArrayList<>();
}
ExcelUtil<RepairDetailsExport> util = new ExcelUtil<>(RepairDetailsExport.class);
util.exportExcel(response, listExport, "机具维修报表", "机具维修报表");
}
/**
* -----------维修审核查询页面接口----------
*/
@ -498,4 +527,36 @@ public class RepairController extends BaseController {
List<RepairTask> list = service.getRepairAuditQueryList(bean);
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
}
/**
* 导出修试审核任务详情列表
*/
@PostMapping("/exportAuditDetails")
@SysLog(title = "导出修试审核任务详情列表", businessType = OperaType.EXPORT, module = "机具系统->导出修试审核任务详情列表")
public void exportAuditDetails(HttpServletResponse response, RepairAuditDetails bean) {
if (Objects.isNull(bean)) {
bean = new RepairAuditDetails();
}
if (Objects.isNull(bean.getTaskType())) {
bean.setTaskType(TM_TASK_REPAIR_AUDIT.getTaskTypeId());
}
List<RepairAuditDetailsExport> listExport = new ArrayList<>();
repairAuditDetailsService.queryTimeCope(bean);
RepairTask repairTask = new RepairTask();
repairTask.setTaskType(bean.getTaskType());
repairTask.setTaskStatus(Integer.valueOf(bean.getTaskStatus()));
repairTask.setStartTime(bean.getStartTime());
repairTask.setEndTime(bean.getEndTime());
repairTask.setKeyWord(bean.getKeyWord());
List<RepairTask> list = service.getRepairAuditQueryList(repairTask);
for (RepairTask repairTask1 : list){
RepairAuditDetailsExport repairAuditDetailsExport = new RepairAuditDetailsExport();
BeanUtils.copyProperties(repairTask1, repairAuditDetailsExport);
listExport.add(repairAuditDetailsExport);
}
ExcelUtil<RepairAuditDetailsExport> util = new ExcelUtil<>(RepairAuditDetailsExport.class);
util.exportExcel(response, listExport, "入库单", "入库单");
}
}

View File

@ -0,0 +1,234 @@
package com.bonus.material.repair.domain;
import com.bonus.common.core.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
* @author syruan
*/
@Data
@ApiModel(value="维修任务")
public class RepairAuditDetailsExport {
private Long id;
/**
* 任务id
*/
@ApiModelProperty(value = "任务id")
private Long taskId;
@ApiModelProperty(value = "前置任务id")
private Long preTaskId;
@ApiModelProperty(value = "任务状态")
private Integer taskStatus;
@ApiModelProperty(value = "任务类型")
private Integer taskType;
@ApiModelProperty(value = "任务当月序号 例如:1 插入及查询时请携带任务类型")
private Integer monthOrder;
@ApiModelProperty(value = "维修拆分层级")
private String level;
@ApiModelProperty(value = "维修拆分父级id")
private Long parentId;
@ApiModelProperty(value = "序号")
@Excel(name = "序号", isSequence = true, sort = 0)
private String serialNumber;
/**
* 退料单位名称
*/
@ApiModelProperty(value = "退料单位名称")
private String backUnit;
/**
* 退料工程名称
*/
@ApiModelProperty(value = "退料工程名称")
private String backPro;
/**
* 退料单号
*/
@ApiModelProperty(value = "退料单号")
private String backCode;
/**
* 维修单号
*/
@ApiModelProperty(value = "维修单号")
@Excel(name = "维修单号",sort = 2)
private String repairCode;
/**
* 维修机具类型
*/
@ApiModelProperty(value = "维修机具类型")
@Excel(name = "机具名称",sort = 3)
private String type;
/**
* 规格型号
*/
@ApiModelProperty(value = "规格型号")
@Excel(name = "规格型号",sort = 4)
private String typeName;
@ApiModelProperty(value = "退料数量")
private BigDecimal returnNum;
/**
* 维修总量
*/
@ApiModelProperty(value = "维修总量")
@Excel(name = "退料数量",sort = 5)
private BigDecimal repairNum;
/**
* 维修报废数量
*/
@ApiModelProperty(value = "报废数量")
@Excel(name = "报废数量",sort = 7)
private BigDecimal scrapNum;
@ApiModelProperty(value = "待维修数量")
private BigDecimal beRepairedNum;
/**
* 任务创建人
*/
@ApiModelProperty(value = "任务创建人")
private String createName;
/**
* 任务创建时间
*/
@ApiModelProperty(value = "任务创建时间")
@Excel(name = "审核提交时间", sort = 1)
private String createTime;
/**
* 任务创建人
*/
@ApiModelProperty(value = "任务创建人")
private Long createBy;
/**
* 维修状态
*/
@ApiModelProperty(value = "维修状态")
private String repairStatus;
/**
* 关键字
*/
private String keyWord;
/**
* 开始时间
*/
private String startTime;
/**
* 结束时间
*/
private String endTime;
@ApiModelProperty(value = "组织id")
private Long companyId;
@ApiModelProperty(value = "协议id")
private Long agreementId;
@ApiModelProperty(value = "维修状态编码CODE")
private String repairStatusCode;
/**
* 编码
*/
@ApiModelProperty(value = "编码")
private String code;
/**
* 维修合格数量
*/
@ApiModelProperty(value = "维修合格数量")
@Excel(name = "合格数量",sort = 6)
private BigDecimal repairedNum;
/**
* 待修状态
*/
@ApiModelProperty(value = "待修状态")
private String status;
/**
* 维修人员
*/
@ApiModelProperty(value = "维修人员")
private String repairer;
/**
* 维修时间
*/
@ApiModelProperty(value = "维修时间")
private String updateTime;
/** 导出选中列表 */
@ApiModelProperty(value = "导出选中列表")
private List<Long> dataCondition;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "app维修任务状态0 进行中 1已审核包含通过和驳回")
private Integer appTaskStatus;
/**
* 退料人
*/
private String backPerson;
private List<Long> ids;
private List<Long> taskIds;
@ApiModelProperty(value = "登录用户id")
private Long userId;
@ApiModelProperty(value = "一级类型id")
private String firstId;
/**
* 数据状态 0-未定损1-已定损 3-修饰后入库驳回
*/
private String dataStatus;
private Integer num;
@ApiModelProperty(value = "退料ID")
private Long backId;
/**
* 签名地址
*/
@ApiModelProperty(value = "签名地址")
private String signUrl;
@ApiModelProperty(value = "签名类型 手写0 和 图片上传1")
private int signType;
/**
* 维修完成时间
*/
private String repairTime;
/**
* 单位
*/
private String unit;
@ApiModelProperty(value = "单位id")
private Long unitId;
@ApiModelProperty(value="工程id")
private Long proId;
@ApiModelProperty(value = "类型id")
private String typeId;
@ApiModelProperty(value = "规格id")
private String typeModelId;
}

View File

@ -0,0 +1,239 @@
package com.bonus.material.repair.domain;
import com.bonus.common.core.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
* @author syruan
*/
@Data
@ApiModel(value="维修任务")
public class RepairDetailsExport {
private Long id;
/**
* 任务id
*/
@ApiModelProperty(value = "任务id")
private Long taskId;
@ApiModelProperty(value = "前置任务id")
private Long preTaskId;
@ApiModelProperty(value = "任务状态")
private Integer taskStatus;
@ApiModelProperty(value = "任务类型")
private Integer taskType;
@ApiModelProperty(value = "任务当月序号 例如:1 插入及查询时请携带任务类型")
private Integer monthOrder;
@ApiModelProperty(value = "维修拆分层级")
private String level;
@ApiModelProperty(value = "维修拆分父级id")
private Long parentId;
@ApiModelProperty(value = "序号")
@Excel(name = "序号", isSequence = true, sort = 0)
private String serialNumber;
/**
* 退料单位名称
*/
@ApiModelProperty(value = "退料单位名称")
@Excel(name = "退料单位名称",sort = 4)
private String backUnit;
/**
* 退料工程名称
*/
@ApiModelProperty(value = "退料工程名称")
@Excel(name = "退料工程名称",sort = 5)
private String backPro;
/**
* 退料单号
*/
@ApiModelProperty(value = "退料单号")
@Excel(name = "退料单号",sort = 3)
private String backCode;
/**
* 维修单号
*/
@ApiModelProperty(value = "维修单号")
@Excel(name = "维修单号",sort = 2)
private String repairCode;
/**
* 维修机具类型
*/
@ApiModelProperty(value = "维修机具类型")
@Excel(name = "机具名称",sort = 6)
private String type;
/**
* 规格型号
*/
@ApiModelProperty(value = "规格型号")
@Excel(name = "规格型号",sort = 7)
private String typeName;
@ApiModelProperty(value = "退料数量")
private BigDecimal returnNum;
/**
* 维修总量
*/
@ApiModelProperty(value = "维修总量")
@Excel(name = "维修数量",sort = 10)
private BigDecimal repairNum;
/**
* 维修报废数量
*/
@ApiModelProperty(value = "报废数量")
@Excel(name = "报废数量",sort = 12)
private BigDecimal scrapNum;
@ApiModelProperty(value = "待维修数量")
private BigDecimal beRepairedNum;
/**
* 任务创建人
*/
@ApiModelProperty(value = "任务创建人")
private String createName;
/**
* 任务创建时间
*/
@ApiModelProperty(value = "任务创建时间")
private String createTime;
/**
* 任务创建人
*/
@ApiModelProperty(value = "任务创建人")
private Long createBy;
/**
* 维修状态
*/
@ApiModelProperty(value = "维修状态")
@Excel(name = "维修状态",sort = 9)
private String repairStatus;
/**
* 关键字
*/
private String keyWord;
/**
* 开始时间
*/
private String startTime;
/**
* 结束时间
*/
private String endTime;
@ApiModelProperty(value = "组织id")
private Long companyId;
@ApiModelProperty(value = "协议id")
private Long agreementId;
@ApiModelProperty(value = "维修状态编码CODE")
private String repairStatusCode;
/**
* 编码
*/
@ApiModelProperty(value = "编码")
private String code;
/**
* 维修合格数量
*/
@ApiModelProperty(value = "维修合格数量")
@Excel(name = "维修合格数量",sort = 11)
private BigDecimal repairedNum;
/**
* 待修状态
*/
@ApiModelProperty(value = "待修状态")
private String status;
/**
* 维修人员
*/
@ApiModelProperty(value = "维修人员")
private String repairer;
/**
* 维修时间
*/
@ApiModelProperty(value = "维修时间")
private String updateTime;
/** 导出选中列表 */
@ApiModelProperty(value = "导出选中列表")
private List<Long> dataCondition;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "app维修任务状态0 进行中 1已审核包含通过和驳回")
private Integer appTaskStatus;
/**
* 退料人
*/
private String backPerson;
private List<Long> ids;
private List<Long> taskIds;
@ApiModelProperty(value = "登录用户id")
private Long userId;
@ApiModelProperty(value = "一级类型id")
private String firstId;
/**
* 数据状态 0-未定损1-已定损 3-修饰后入库驳回
*/
private String dataStatus;
private Integer num;
@ApiModelProperty(value = "退料ID")
private Long backId;
/**
* 签名地址
*/
@ApiModelProperty(value = "签名地址")
private String signUrl;
@ApiModelProperty(value = "签名类型 手写0 和 图片上传1")
private int signType;
/**
* 维修完成时间
*/
@Excel(name = "维修时间",sort = 1)
private String repairTime;
/**
* 单位
*/
@Excel(name = "单位",sort = 8)
private String unit;
@ApiModelProperty(value = "单位id")
private Long unitId;
@ApiModelProperty(value="工程id")
private Long proId;
@ApiModelProperty(value = "类型id")
private String typeId;
@ApiModelProperty(value = "规格id")
private String typeModelId;
}

View File

@ -1973,6 +1973,13 @@ public class RepairServiceImpl implements RepairService {
@Override
public List<RepairTask> getRepairQueryList(RepairTask bean) {
try {
Long userId = SecurityUtils.getLoginUser().getUserid();
Set<String> userRoles = SecurityUtils.getLoginUser().getRoles();
// 检查用户是否具有特殊角色
boolean hasSpecialRole = hasSpecialRole(userRoles);
if (!hasSpecialRole) {
bean.setUserId(userId == 0 ? null : userId);
}
return repairMapper.getRepairQueryList(bean);
} catch (Exception e) {
log.error("查询修试查询列表", e.getMessage());
@ -1983,6 +1990,13 @@ public class RepairServiceImpl implements RepairService {
@Override
public List<RepairTask> getRepairAuditQueryList(RepairTask bean) {
try {
Long userId = SecurityUtils.getLoginUser().getUserid();
Set<String> userRoles = SecurityUtils.getLoginUser().getRoles();
// 检查用户是否具有特殊角色
boolean hasSpecialRole = hasSpecialRole(userRoles);
if (!hasSpecialRole) {
bean.setUserId(userId == 0 ? null : userId);
}
return repairMapper.getRepairAuditQueryList(bean);
} catch (Exception e) {
log.error("查询修试查询列表", e.getMessage());

View File

@ -432,6 +432,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
JOIN ma_type_keeper mtk ON mtk.type_id = lod.type_id AND mtk.user_id = #{userId}
</if>
WHERE lod.parent_id = #{id}
<if test="publishTask != null and publishTask != ''">
AND lod.publish_task = #{publishTask}
</if>
<if test="typeIdList != null and typeIdList.size() > 0">
and mt4.type_id in
<foreach item="item" collection="typeIdList" open="(" separator="," close=")">

View File

@ -518,40 +518,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="getByMaCode" resultType="com.bonus.material.ma.domain.Machine">
SELECT
mi.id as maId,
mi.ma_name as materialName,
mi.ma_model as materialModel,
mi.ma_code as maCode,
LEFT(mi.this_check_time, 10) AS thisCheckTime,
LEFT(mi.next_check_time, 10) AS nextCheckTime,
mi.repair_man as repairMan,
mi.check_man as checkMan,
mi.phone,
mi.result,null AS reportCode,null AS reportUrl,
mi.type,
'1' as devType
FROM
ws_ma_info mi
WHERE mi.ma_code LIKE CONCAT('%',#{maCode},'%')
UNION
SELECT
mm.ma_id AS id,
mt2.type_name as maName,
mt.type_name as maModel,
mm.ma_code as maCode,
LEFT(mm.this_check_time, 10) AS thisCheckTime,
LEFT(mm.next_check_time, 10) AS nextCheckTime,
mm.check_man as repairMan,
ifnull(mm.inspect_man,"高民") as checkMan,
"0551-63703966" as phone,
"合格" as result,mm.ex_code AS reportCode,mm.ex_url AS reportUrl,
is_jj as type,
'2' as devType
FROM ma_machine mm
LEFT JOIN ma_type mt on mm.type_id = mt.type_id
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
WHERE mm.ma_code LIKE CONCAT('%',#{maCode},'%') and mt.MANAGE_TYPE =0
SELECT *
FROM (
SELECT mi.id as maId,
mi.ma_name as materialName,
mi.ma_model as materialModel,
mi.ma_code as maCode,
DATE_FORMAT(STR_TO_DATE(LEFT(mi.this_check_time, 10), '%Y-%c-%e'), '%Y-%m-%d') AS thisCheckTime,
DATE_FORMAT(STR_TO_DATE(LEFT(mi.next_check_time, 10), '%Y-%c-%e'), '%Y-%m-%d') AS nextCheckTime,
mi.repair_man as repairMan,
mi.check_man as checkMan,
mi.phone,
mi.result,
null AS reportCode,
null AS reportUrl,
mi.type,
'1' as devType
FROM ws_ma_info mi
WHERE mi.ma_code LIKE CONCAT('%', #{maCode}, '%')
UNION
SELECT mm.ma_id AS id,
mt2.type_name as maName,
mt.type_name as maModel,
mm.ma_code as maCode,
DATE_FORMAT(STR_TO_DATE(LEFT(mm.this_check_time, 10), '%Y-%c-%e'), '%Y-%m-%d') AS thisCheckTime,
DATE_FORMAT(STR_TO_DATE(LEFT(mm.next_check_time, 10), '%Y-%c-%e'), '%Y-%m-%d') AS nextCheckTime,
mm.check_man as repairMan,
ifnull(mm.inspect_man, "高民") as checkMan,
"0551-63703966" as phone,
"合格" as result,
mm.ex_code AS reportCode,
mm.ex_url AS reportUrl,
is_jj as type,
'2' as devType
FROM ma_machine mm
LEFT JOIN ma_type mt on mm.type_id = mt.type_id
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
WHERE mm.ma_code LIKE CONCAT('%', #{maCode}, '%')
and mt.MANAGE_TYPE = 0
) AS combined_result LIMIT 100;
</select>
<delete id="deleteMachineByMaCodeAndTypeId">

View File

@ -1688,6 +1688,9 @@
LEFT JOIN back_apply_info bai ON rad.back_id = bai.id
LEFT JOIN ma_type mt on mt.type_id=rad.type_id
LEFT JOIN ma_type mt2 on mt2.type_id=mt.parent_id
<if test="userId != null">
JOIN ma_type_repair mtr ON mtr.type_id = rad.type_id AND mtr.user_id = #{userId}
</if>
WHERE
rad.is_ds = 0
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
@ -1715,6 +1718,15 @@
<if test="typeModelId != null and typeModelId!=''">
and mt.type_id = #{typeModelId}
</if>
<if test="repairStatus != null and repairStatus != ''">
AND tt.task_status = #{repairStatus}
</if>
<if test="appTaskStatus != null and appTaskStatus == 0">
and (tt.task_status = 3 or tt.task_status = 4)
</if>
<if test="appTaskStatus != null and appTaskStatus == 1">
and (tt.task_status = 1 or tt.task_status = 2)
</if>
GROUP BY rad.task_id,rad.type_id
ORDER BY tt.create_time desc
</select>
@ -1732,6 +1744,9 @@
LEFT JOIN tm_task tt2 ON tt2.task_id = rad.repair_id
LEFT JOIN ma_type mt ON rad.type_id = mt.type_id
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
<if test="userId != null">
JOIN ma_type_repair mtr ON mtr.type_id = rad.type_id AND mtr.user_id = #{userId}
</if>
WHERE tt.create_time &lt; '2025-08-20 00:00:00'
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND tt.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
@ -1749,6 +1764,9 @@
<if test="typeModelId != null and typeModelId!=''">
and mt.type_id = #{typeModelId}
</if>
<if test="taskStatus != null and taskStatus != ''">
AND tt.task_status = #{taskStatus}
</if>
GROUP BY rad.task_id, rad.type_id
UNION
@ -1765,6 +1783,9 @@
LEFT JOIN tm_task tt2 ON tt2.task_id = tt.pre_task_id
LEFT JOIN ma_type mt ON rad.type_id = mt.type_id
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
<if test="userId != null">
JOIN ma_type_repair mtr ON mtr.type_id = rad.type_id AND mtr.user_id = #{userId}
</if>
WHERE tt.create_time &gt;= '2025-08-20 00:00:00'
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND tt.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
@ -1782,6 +1803,9 @@
<if test="typeModelId != null and typeModelId!=''">
and mt.type_id = #{typeModelId}
</if>
<if test="taskStatus != null and taskStatus != ''">
AND tt.task_status = #{taskStatus}
</if>
GROUP BY rad.task_id, rad.type_id) a
order by createTime desc
</select>

View File

@ -329,8 +329,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sai.lease_price as leasePrice,
sai.num as num,
DATE(sai.start_time) as startTime,
DATE(sai.end_time) as endTime,
DATEDIFF(IF(sai.end_time is null,CURDATE(),sai.end_time), sai.start_time) + 1 as leaseDays
IF(sai.end_time is null, if(sai.is_slt = 1, sai.slt_time, CURDATE()) ,sai.end_time) as endTime,
DATEDIFF(IF(sai.end_time is null, if(sai.is_slt = 1, sai.slt_time, CURDATE()) ,sai.end_time), sai.start_time) + 1 as leaseDays
from slt_agreement_info sai
LEFT JOIN bm_agreement_info bai on sai.agreement_id = bai.agreement_id
LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id