Merge remote-tracking branch 'origin/master'

This commit is contained in:
hongchao 2025-10-10 20:59:43 +08:00
commit 2e50eb1ad0
14 changed files with 521 additions and 316 deletions

View File

@ -364,7 +364,7 @@ public class MaterialLeaseInfoController extends BaseController {
bean.setIsExport(0); bean.setIsExport(0);
List<LeaseTotalInfo> list = materialLeaseInfoService.getLeaseInfoDetails(bean); List<LeaseTotalInfo> list = materialLeaseInfoService.getLeaseInfoDetails(bean);
ExcelUtil<LeaseTotalInfo> util = new ExcelUtil<>(LeaseTotalInfo.class); ExcelUtil<LeaseTotalInfo> util = new ExcelUtil<>(LeaseTotalInfo.class);
util.exportExcel(response, list, "综合查询--工器具领料记录查询", "工器具领料记录查询"); util.exportExcel(response, list, "综合查询--项目部材料站出库一览表", "项目部材料站出库一览表 (导出时间:" + DateUtils.getTime() + "" );
} }
/** /**

View File

@ -0,0 +1,83 @@
package com.bonus.material.clz.domain.back;
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.Date;
/**
* @author xliu
* @date 2025/10/10 15:41
*/
@Data
public class MaterialBackExportVO {
@ApiModelProperty(value = "序号")
@Excel(name = "序号", isSequence = true, sort = 0)
private String serialNumber;
@Excel(name = "分公司")
@ApiModelProperty(value = "分公司")
private String impUnitName;
@Excel(name = "退料工程")
@ApiModelProperty(value = "退料工程")
private String proName;
@Excel(name = "单位名称")
@ApiModelProperty(value = "单位名称")
private String unitName;
@Excel(name = "退料人")
@ApiModelProperty(value = "退料人")
private String backPerson;
@ApiModelProperty(value = "物资类型")
private String materialType;
@Excel(name = "退料单号")
@ApiModelProperty(value = "退料单号")
private String code;
@ApiModelProperty(value = "工器具名称")
@Excel(name = "工器具名称")
private String materialName;
@Excel(name = "规格型号")
@ApiModelProperty(value = "规格型号")
private String typeModelName;
@ApiModelProperty(value = "类型名称")
@Excel(name = "类型名称")
private String typeCode;
/** 退料数量 */
@ApiModelProperty(value = "预退数量")
@Excel(name = "预退数量", cellType = Excel.ColumnType.NUMERIC)
private BigDecimal backNum;
@Excel(name = "退料数量",cellType = Excel.ColumnType.NUMERIC)
@ApiModelProperty(value = "退料数量")
private BigDecimal outNum;
@ApiModelProperty(value = "计量单位")
@Excel(name = "计量单位")
private String unit;
@Excel(name = "退料时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "退料时间")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date backTime;
}

View File

@ -25,6 +25,18 @@ public class LeaseTotalInfo {
private Long parentId; private Long parentId;
@ApiModelProperty(value = "序号")
@Excel(name = "序号", isSequence = true, sort = 0)
private String serialNumber;
@ApiModelProperty(value = "分公司")
@Excel(name = "分公司")
private String impUnitName;
@ApiModelProperty(value = "领料工程")
@Excel(name = "领料工程")
private String projectName;
@ApiModelProperty(value = "工器具名称") @ApiModelProperty(value = "工器具名称")
@Excel(name = "工器具名称") @Excel(name = "工器具名称")
private String maTypeName; private String maTypeName;
@ -41,30 +53,25 @@ public class LeaseTotalInfo {
private BigDecimal preNum; private BigDecimal preNum;
@ApiModelProperty(value = "出库数量") @ApiModelProperty(value = "出库数量")
@Excel(name = "出库数量") @Excel(name = "出库数量", cellType = Excel.ColumnType.NUMERIC)
private BigDecimal outNum; private BigDecimal outNum;
@ApiModelProperty(value = "分包单位")
@Excel(name = "分包单位")
private String subUnitName;
@ApiModelProperty(value = "待出库数量") @ApiModelProperty(value = "待出库数量")
private BigDecimal pendingNum; private BigDecimal pendingNum;
@ApiModelProperty(value = "领料日期") @ApiModelProperty(value = "领料日期")
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "领料日期", dateFormat = "yyyy-MM-dd", width = 30) // @Excel(name = "领料日期", dateFormat = "yyyy-MM-dd", width = 30)
private String leaseDate; private String leaseDate;
@ApiModelProperty(value = "出库日期")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "出库日期", dateFormat = "yyyy-MM-dd", width = 30)
private String outDate;
@ApiModelProperty(value = "领料班组") @ApiModelProperty(value = "领料班组")
@Excel(name = "领料班组") @Excel(name = "领料班组")
private String teamName; private String teamName;
@ApiModelProperty(value = "领料工程")
@Excel(name = "领料工程")
private String projectName;
@ApiModelProperty(value = "领料人") @ApiModelProperty(value = "领料人")
@Excel(name = "班组长") @Excel(name = "班组长")
private String leasePerson; private String leasePerson;
@ -76,7 +83,10 @@ public class LeaseTotalInfo {
@ApiModelProperty(value = "领料单号") @ApiModelProperty(value = "领料单号")
@Excel(name = "领料单号") @Excel(name = "领料单号")
private String code; private String code;
@ApiModelProperty(value = "出库日期")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "出库日期", dateFormat = "yyyy-MM-dd", width = 30)
private String outDate;
@ApiModelProperty(value = "开始时间") @ApiModelProperty(value = "开始时间")
private String startTime; private String startTime;
@ -103,22 +113,16 @@ public class LeaseTotalInfo {
*/ */
private List<String> projectIdList; private List<String> projectIdList;
@ApiModelProperty(value = "分公司")
@Excel(name = "分公司")
private String impUnitName;
@ApiModelProperty(value = "项目部") @ApiModelProperty(value = "项目部")
@Excel(name = "项目部") // @Excel(name = "项目部")
private String departName; private String departName;
@ApiModelProperty(value = "工程名称") @ApiModelProperty(value = "工程名称")
@Excel(name = "工程名称") // @Excel(name = "工程名称")
private String proName; private String proName;
@ApiModelProperty(value = "分包单位")
@Excel(name = "分包单位")
private String subUnitName;
@ApiModelProperty(value = "工程id") @ApiModelProperty(value = "工程id")
private String proId; private String proId;
} }

View File

@ -4,6 +4,7 @@ import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.material.clz.domain.back.MaterialBackApplyDetails; import com.bonus.material.clz.domain.back.MaterialBackApplyDetails;
import com.bonus.material.clz.domain.back.MaterialBackApplyInfo; import com.bonus.material.clz.domain.back.MaterialBackApplyInfo;
import com.bonus.material.clz.domain.back.MaterialBackApplyTotalInfo; import com.bonus.material.clz.domain.back.MaterialBackApplyTotalInfo;
import com.bonus.material.clz.domain.back.MaterialBackExportVO;
import com.bonus.material.clz.domain.vo.back.MaterialBackApplyRequestVo; import com.bonus.material.clz.domain.vo.back.MaterialBackApplyRequestVo;
import com.bonus.material.clz.domain.vo.back.MaterialBackMaCodeVo; import com.bonus.material.clz.domain.vo.back.MaterialBackMaCodeVo;
@ -120,4 +121,6 @@ public interface MaterialBackApplyInfoService {
* @return * @return
*/ */
AjaxResult getMachine(MaterialBackApplyInfo dto); AjaxResult getMachine(MaterialBackApplyInfo dto);
List<MaterialBackExportVO> exportBackInfoExcl(MaterialBackApplyInfo bean);
} }

View File

@ -50,7 +50,6 @@ import com.bonus.material.work.domain.SysWorkflowRecordHistory;
import com.bonus.material.work.domain.SysWorkflowType; import com.bonus.material.work.domain.SysWorkflowType;
import com.bonus.material.work.mapper.*; import com.bonus.material.work.mapper.*;
import com.bonus.system.api.domain.SysUser; import com.bonus.system.api.domain.SysUser;
import com.sun.org.apache.bcel.internal.generic.NEW;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.util.UriComponentsBuilder; import org.springframework.web.util.UriComponentsBuilder;

View File

@ -13,6 +13,7 @@ import com.bonus.common.biz.enums.TmTaskTypeEnum;
import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils; 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.utils.bean.BeanUtils;
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.domain.BackApplyInfo; import com.bonus.material.back.domain.BackApplyInfo;
@ -20,6 +21,7 @@ import com.bonus.material.back.domain.MaCodeDto;
import com.bonus.material.back.domain.vo.MaCodeVo; import com.bonus.material.back.domain.vo.MaCodeVo;
import com.bonus.material.basic.mapper.BmFileInfoMapper; import com.bonus.material.basic.mapper.BmFileInfoMapper;
import com.bonus.material.clz.domain.BmTeam; import com.bonus.material.clz.domain.BmTeam;
import com.bonus.material.clz.domain.back.MaterialBackExportVO;
import com.bonus.material.clz.domain.lease.MaterialLeaseApplyInfo; import com.bonus.material.clz.domain.lease.MaterialLeaseApplyInfo;
import com.bonus.material.clz.mapper.IwsTeamUserMapper; import com.bonus.material.clz.mapper.IwsTeamUserMapper;
import com.bonus.material.clz.mapper.MaterialMachineMapper; import com.bonus.material.clz.mapper.MaterialMachineMapper;
@ -92,7 +94,7 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
boolean hasSpecialRole = hasSpecialRole(userRoles); boolean hasSpecialRole = hasSpecialRole(userRoles);
if (!hasSpecialRole) { if (!hasSpecialRole) {
// 根据用户名判断用户是否为班组长 // 根据用户名判断用户是否为班组长
teamData = materialMachineMapper.getTeamData(username); teamData = materialMachineMapper.getTeamData(username);
if (teamData == null) { if (teamData == null) {
// 根据用户名查询项目部信息 // 根据用户名查询项目部信息
List<String> departId = mapper.getDepartId(username); List<String> departId = mapper.getDepartId(username);
@ -226,6 +228,7 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
*/ */
@Override @Override
public List<MaterialBackApplyInfo> getTotalList(MaterialBackApplyInfo backApplyInfo) { public List<MaterialBackApplyInfo> getTotalList(MaterialBackApplyInfo backApplyInfo) {
long time1 = System.currentTimeMillis();
Set<String> userRoles = SecurityUtils.getLoginUser().getRoles(); Set<String> userRoles = SecurityUtils.getLoginUser().getRoles();
String username = SecurityUtils.getLoginUser().getUsername(); String username = SecurityUtils.getLoginUser().getUsername();
// 检查用户是否具有特殊角色 // 检查用户是否具有特殊角色
@ -234,16 +237,23 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
if (!hasSpecialRole) { if (!hasSpecialRole) {
// 根据用户名判断用户是否为班组长 // 根据用户名判断用户是否为班组长
teamData = materialMachineMapper.getTeamData(username); teamData = materialMachineMapper.getTeamData(username);
long time2 = System.currentTimeMillis();
System.err.println("查询用户信息耗时time2 - time1" + (time2 - time1));
if (teamData == null) { if (teamData == null) {
// 根据用户名查询项目部信息 // 根据用户名查询项目部信息
List<String> departId = mapper.getDepartId(username); List<String> departId = mapper.getDepartId(username);
long time3 = System.currentTimeMillis();
System.err.println("查询用户所属项目部信息耗时time3 - time2" + (time3 - time2));
// 根据项目部id查询工程信息 // 根据项目部id查询工程信息
List<String> projectIdList = mapper.getProjectId(departId); List<String> projectIdList = mapper.getProjectId(departId);
if (!org.springframework.util.CollectionUtils.isEmpty(projectIdList)) { if (!org.springframework.util.CollectionUtils.isEmpty(projectIdList)) {
backApplyInfo.setProjectIdList(projectIdList); backApplyInfo.setProjectIdList(projectIdList);
} }
long time4 = System.currentTimeMillis();
System.err.println("查询用户所属项目部工程信息耗时time4 - time3" + (time4 - time3));
} }
} }
long time5 = System.currentTimeMillis();
List<MaterialBackApplyInfo> list = materialBackInfoMapper.getTotalList(backApplyInfo); List<MaterialBackApplyInfo> list = materialBackInfoMapper.getTotalList(backApplyInfo);
if (!hasSpecialRole) { if (!hasSpecialRole) {
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
@ -252,6 +262,8 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
list.removeIf(info -> !deptId.toString().equals(info.getImpUnit())); list.removeIf(info -> !deptId.toString().equals(info.getImpUnit()));
} }
} }
long time6 = System.currentTimeMillis();
System.err.println("查询总站点退料记录数据耗时time6 - time5" + (time6 - time5));
if (!org.springframework.util.CollectionUtils.isEmpty(list)) { if (!org.springframework.util.CollectionUtils.isEmpty(list)) {
// 班组长权限 // 班组长权限
if (teamData != null) { if (teamData != null) {
@ -264,6 +276,8 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
list = filterList(list, username); list = filterList(list, username);
}*/ }*/
} }
long time7 = System.currentTimeMillis();
System.err.println("过滤数据耗时time7 - time6" + (time7 - time6));
// 新增typeName过滤条件 // 新增typeName过滤条件
if (!org.springframework.util.CollectionUtils.isEmpty(list) && !StringUtils.isBlank(backApplyInfo.getTypeName())) { if (!org.springframework.util.CollectionUtils.isEmpty(list) && !StringUtils.isBlank(backApplyInfo.getTypeName())) {
list = list.stream() list = list.stream()
@ -281,6 +295,8 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
// 查询所有未结算的工程 // 查询所有未结算的工程
List<String> projectIdList = mapper.getUnsettledProId(); List<String> projectIdList = mapper.getUnsettledProId();
long time8 = System.currentTimeMillis();
System.err.println("查询所有未结算的工程耗时time8 - time7" + (time8 - time7));
// 使用 HashSet 来加速查找过程 // 使用 HashSet 来加速查找过程
Set<String> unsettledProjectIds = new HashSet<>(projectIdList); Set<String> unsettledProjectIds = new HashSet<>(projectIdList);
// 过滤掉不在未结算工程集合内的设备 // 过滤掉不在未结算工程集合内的设备
@ -294,6 +310,8 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
iterator.remove(); iterator.remove();
} }
} }
long time9 = System.currentTimeMillis();
System.err.println("过滤未结算工程耗时time9 - time8" + (time9 - time8));
} }
return list; return list;
} }
@ -640,7 +658,7 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
boolean hasSpecialRole = hasSpecialRole(userRoles); boolean hasSpecialRole = hasSpecialRole(userRoles);
if (!hasSpecialRole) { if (!hasSpecialRole) {
// 根据用户名判断用户是否为班组长 // 根据用户名判断用户是否为班组长
teamData = materialMachineMapper.getTeamData(username); teamData = materialMachineMapper.getTeamData(username);
if (teamData == null) { if (teamData == null) {
// 根据用户名查询项目部信息 // 根据用户名查询项目部信息
List<String> departId = mapper.getDepartId(username); List<String> departId = mapper.getDepartId(username);
@ -1303,4 +1321,26 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
(item.getBackPerson() != null && item.getBackPerson().contains(keyWord)) || (item.getBackPerson() != null && item.getBackPerson().contains(keyWord)) ||
(item.getCode() != null && item.getCode().contains(keyWord)); (item.getCode() != null && item.getCode().contains(keyWord));
} }
@Override
public List<MaterialBackExportVO> exportBackInfoExcl(MaterialBackApplyInfo backApplyInfo) {
List<MaterialBackApplyInfo> list = this.getTotalList(backApplyInfo);
List<MaterialBackExportVO> result = new ArrayList<>();
for (MaterialBackApplyInfo bean: list) {
bean.setParentId(bean.getId());
List<MaterialBackApplyInfo> details = this.getDetailsList(bean);
for (MaterialBackApplyInfo detail: details){
MaterialBackExportVO vo = new MaterialBackExportVO();
BeanUtils.copyProperties(bean, vo);
vo.setUnit(detail.getUnitNames());
vo.setOutNum(detail.getBackNum());
vo.setBackNum(detail.getBackNum());
vo.setTypeModelName(detail.getModelCode());
vo.setMaterialName(detail.getTypeName());
vo.setTypeCode(detail.getTypeCode());
result.add( vo);
}
}
return result;
}
} }

View File

@ -9,6 +9,7 @@ import javax.validation.constraints.NotNull;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import com.bonus.common.biz.annotation.StoreLog; import com.bonus.common.biz.annotation.StoreLog;
import com.bonus.common.biz.config.ListPagingUtil; import com.bonus.common.biz.config.ListPagingUtil;
import com.bonus.common.core.utils.DateUtils;
import com.bonus.common.core.utils.ServletUtils; import com.bonus.common.core.utils.ServletUtils;
import com.bonus.common.log.enums.OperaType; import com.bonus.common.log.enums.OperaType;
import com.bonus.material.basic.domain.report.LeaseOutInfo; import com.bonus.material.basic.domain.report.LeaseOutInfo;
@ -95,7 +96,7 @@ public class RepairAuditDetailsController extends BaseController {
repairAuditDetailsService.queryTimeCope(bean); repairAuditDetailsService.queryTimeCope(bean);
List<ScrapApplyDetailsVO> list = repairAuditDetailsService.selectRepairQuestList(bean); List<ScrapApplyDetailsVO> list = repairAuditDetailsService.selectRepairQuestList(bean);
ExcelUtil<ScrapApplyDetailsVO> util = new ExcelUtil<>(ScrapApplyDetailsVO.class); ExcelUtil<ScrapApplyDetailsVO> util = new ExcelUtil<>(ScrapApplyDetailsVO.class);
util.exportExcel(response, list, "修试审核任务列表"); util.exportExcel(response, list, "修试审核任务列表", "修试审核数据一览表(导出时间:" + DateUtils.getTime() + "");
} }
/** /**

View File

@ -3,6 +3,7 @@ package com.bonus.material.repair.controller;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import com.bonus.common.biz.config.ListPagingUtil; import com.bonus.common.biz.config.ListPagingUtil;
import com.bonus.common.core.exception.ServiceException; 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.ServletUtils;
import com.bonus.common.core.utils.poi.ExcelUtil; import com.bonus.common.core.utils.poi.ExcelUtil;
import com.bonus.common.core.web.controller.BaseController; import com.bonus.common.core.web.controller.BaseController;
@ -255,7 +256,7 @@ public class RepairController extends BaseController {
list = new ArrayList<>(); list = new ArrayList<>();
} }
ExcelUtil<RepairTask> util = new ExcelUtil<>(RepairTask.class); ExcelUtil<RepairTask> util = new ExcelUtil<>(RepairTask.class);
util.exportExcel(response, list, "维修任务列表"); util.exportExcel(response, list, "维修任务列表", "维修任务一览表 (导出时间:" + DateUtils.getTime() + "");
} }
@ApiOperation(value = "获取修试后入库列表") @ApiOperation(value = "获取修试后入库列表")

View File

@ -40,53 +40,86 @@ public class RepairTask {
@ApiModelProperty(value = "维修拆分父级id") @ApiModelProperty(value = "维修拆分父级id")
private Long parentId; private Long parentId;
/** @ApiModelProperty(value = "序号")
* 维修单号 @Excel(name = "序号", isSequence = true, sort = 0)
*/ private String serialNumber;
@ApiModelProperty(value = "维修单号")
@Excel(name = "维修单号",sort = 1)
private String repairCode;
/** /**
* 退料单位名称 * 退料单位名称
*/ */
@ApiModelProperty(value = "退料单位名称") @ApiModelProperty(value = "退料单位名称")
@Excel(name = "退料单位名称",sort = 2) @Excel(name = "退料单位名称",sort = 1)
private String backUnit; private String backUnit;
/** /**
* 退料工程名称 * 退料工程名称
*/ */
@ApiModelProperty(value = "退料工程名称") @ApiModelProperty(value = "退料工程名称")
@Excel(name = "退料工程名称",sort = 3) @Excel(name = "退料工程名称",sort = 2)
private String backPro; private String backPro;
/**
* 退料单号
*/
@ApiModelProperty(value = "退料单号")
@Excel(name = "退料单号",sort = 3)
private String backCode;
/**
* 维修单号
*/
@ApiModelProperty(value = "维修单号")
@Excel(name = "维修单号",sort = 4)
private String repairCode;
/**
* 维修机具类型
*/
@ApiModelProperty(value = "维修机具类型")
@Excel(name = "物资名称",sort = 5)
private String type;
/**
* 规格型号
*/
@ApiModelProperty(value = "规格型号")
@Excel(name = "规格型号",sort = 6)
private String typeName;
@ApiModelProperty(value = "退料数量")
@Excel(name = "退料数量",sort = 7)
private BigDecimal returnNum;
/**
* 维修总量
*/
@ApiModelProperty(value = "维修总量")
@Excel(name = "维修数量",sort = 8)
private BigDecimal repairNum;
/**
* 维修报废数量
*/
@ApiModelProperty(value = "报废数量")
@Excel(name = "报废数量",sort = 9)
private BigDecimal scrapNum;
@ApiModelProperty(value = "待维修数量")
@Excel(name = "待维修数量",sort = 10)
private BigDecimal beRepairedNum;
/**
* 任务创建人
*/
@ApiModelProperty(value = "任务创建人")
@Excel(name = "任务创建人",sort = 11)
private String createName;
/**
* 任务创建时间
*/
@ApiModelProperty(value = "任务创建时间")
@Excel(name = "任务创建时间",sort = 12)
private String createTime;
/** /**
* 任务创建人 * 任务创建人
*/ */
@ApiModelProperty(value = "任务创建人") @ApiModelProperty(value = "任务创建人")
private Long createBy; private Long createBy;
/**
* 任务创建人
*/
@ApiModelProperty(value = "任务创建人")
@Excel(name = "任务创建人",sort = 4)
private String createName;
/**
* 任务创建时间
*/
@ApiModelProperty(value = "任务创建时间")
@Excel(name = "任务创建时间",sort = 5)
private String createTime;
/**
* 退料单号
*/
@ApiModelProperty(value = "退料单号")
@Excel(name = "退料单号",sort = 6)
private String backCode;
/** /**
* 维修状态 * 维修状态
*/ */
@ApiModelProperty(value = "维修状态") @ApiModelProperty(value = "维修状态")
@Excel(name = "维修状态",sort = 7) // @Excel(name = "维修状态",sort = 7)
private String repairStatus; private String repairStatus;
/** /**
* 关键字 * 关键字
@ -110,47 +143,26 @@ public class RepairTask {
@ApiModelProperty(value = "维修状态编码CODE") @ApiModelProperty(value = "维修状态编码CODE")
private String repairStatusCode; private String repairStatusCode;
/**
* 维修机具类型
*/
@ApiModelProperty(value = "维修机具类型")
@Excel(name = "维修机具类型",sort = 8)
private String type;
/**
* 规格型号
*/
@ApiModelProperty(value = "规格型号")
@Excel(name = "规格型号",sort = 9)
private String typeName;
/** /**
* 编码 * 编码
*/ */
@ApiModelProperty(value = "编码") @ApiModelProperty(value = "编码")
@Excel(name = "编码",sort = 10) // @Excel(name = "编码",sort = 10)
private String code; private String code;
/**
* 维修总量
*/
@ApiModelProperty(value = "维修总量")
@Excel(name = "维修总量",sort = 11)
private BigDecimal repairNum;
/** /**
* 维修合格数量 * 维修合格数量
*/ */
@ApiModelProperty(value = "维修合格数量") @ApiModelProperty(value = "维修合格数量")
@Excel(name = "维修合格数量",sort = 12) // @Excel(name = "维修合格数量",sort = 12)
private BigDecimal repairedNum; private BigDecimal repairedNum;
/**
* 维修报废数量
*/
@ApiModelProperty(value = "报废数量")
@Excel(name = "维修报废数量",sort = 13)
private BigDecimal scrapNum;
/** /**
* 待修状态 * 待修状态
*/ */
@ApiModelProperty(value = "待修状态") @ApiModelProperty(value = "待修状态")
@Excel(name = "待修状态",sort = 14) // @Excel(name = "待修状态",sort = 14)
private String status; private String status;
/** /**
* 维修人员 * 维修人员
@ -162,7 +174,7 @@ public class RepairTask {
* 维修时间 * 维修时间
*/ */
@ApiModelProperty(value = "维修时间") @ApiModelProperty(value = "维修时间")
@Excel(name = "维修时间",sort = 16) // @Excel(name = "维修时间",sort = 16)
private String updateTime; private String updateTime;
/** 导出选中列表 */ /** 导出选中列表 */

View File

@ -5,6 +5,7 @@ import com.bonus.material.scrap.domain.ScrapAuditorSet;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
/** /**
@ -21,11 +22,16 @@ public class ScrapApplyDetailsVO {
/** /**
* 报废审核单号 * 报废审核单号
*/ */
@Excel(name = "任务单号",sort = 4) // @Excel(name = "任务单号",sort = 4)
private String scrapNum; private String scrapNum;
@ApiModelProperty(value = "维修任务单号") @ApiModelProperty(value = "维修任务单号")
private String repairTaskCode; private String repairTaskCode;
@ApiModelProperty(value = "序号")
@Excel(name = "序号", isSequence = true, sort = 0)
private String serialNumber;
/** /**
* 单位名称 * 单位名称
*/ */
@ -35,44 +41,64 @@ public class ScrapApplyDetailsVO {
/** /**
* 工程名称 * 工程名称
*/ */
@Excel(name = "工程名称",sort = 2) @Excel(name = "退料工程",sort = 2)
private String projectName; private String projectName;
@Excel(name = "退料单号",sort = 3)
private String backCode;
@Excel(name = "维修审核单号",sort = 4)
private String auditCode;
@Excel(name = "物资类型",sort = 5)
private String typeName2;
@Excel(name = "退料数量",sort = 6, cellType = Excel.ColumnType.NUMERIC)
private BigDecimal repairNum2;
@Excel(name = "合格数量",sort = 7, cellType = Excel.ColumnType.NUMERIC)
private BigDecimal repairedNum;
@Excel(name = "报废数量",sort = 8, cellType = Excel.ColumnType.NUMERIC)
private BigDecimal scrapNum3;
@Excel(name = "维修人",sort = 9)
private String createBy2;
@Excel(name = "审核时间", dateFormat = "yyyy-MM-dd HH:mm:ss", sort = 10)
private String auditTime;
/** /**
* 维修班组名称 * 维修班组名称
*/ */
@Excel(name = "维修班组",sort = 6) // @Excel(name = "维修班组",sort = 6)
//@ApiModelProperty(value = "维修班组") //@ApiModelProperty(value = "维修班组")
private String teamName; private String teamName;
/** /**
* 任务创建人 * 任务创建人
*/ */
@Excel(name = "提交人",sort = 7) // @Excel(name = "提交人",sort = 7)
private String createBy; private String createBy;
/** /**
* 机具类型 * 机具类型
*/ */
@Excel(name = "物资类型",sort = 5) // @Excel(name = "物资类型",sort = 5)
private String itemType; private String itemType;
/** /**
* 创建时间 * 创建时间
*/ */
@Excel(name = "提交时间",sort = 8) // @Excel(name = "提交时间",sort = 8)
private String createTime; private String createTime;
/** /**
* 维修单号 * 维修单号
*/ */
@Excel(name = "维修审核单号",sort = 3) // @Excel(name = "维修审核单号",sort = 3)
private String repairNum; private String repairNum;
/** /**
* 审核状态 * 审核状态
*/ */
@Excel(name = "状态",sort = 9,readConverterExp = "10=维修审核进行中,11=维修审核完成,12=维修审核被驳回") // @Excel(name = "状态",sort = 9,readConverterExp = "10=维修审核进行中,11=维修审核完成,12=维修审核被驳回")
private Integer taskStatus; private Integer taskStatus;
/** /**

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.material.clz.mapper.MaterialBackInfoMapper"> <mapper namespace="com.bonus.material.clz.mapper.MaterialBackInfoMapper">
<insert id="insertBackApplyInfo" useGeneratedKeys="true" keyProperty="id"> <insert id="insertBackApplyInfo" useGeneratedKeys="true" keyProperty="id">
insert into clz_back_apply_info insert into clz_back_apply_info
@ -128,19 +128,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateStlInfo"> <update id="updateStlInfo">
update clz_slt_agreement_info update clz_slt_agreement_info
set end_time = now(), set end_time = now(),
update_time = now(), update_time = now(),
back_id = #{record.id}, back_id = #{record.id},
status = '1' status = '1'
where id = #{info.id} where id = #{info.id}
</update> </update>
<update id="updateStlInfoTwo"> <update id="updateStlInfoTwo">
update clz_slt_agreement_info update clz_slt_agreement_info
set num = #{backNum}, set num = #{backNum},
end_time = now(), end_time = now(),
update_time = now(), update_time = now(),
back_id = #{record.id}, back_id = #{record.id},
status = '1' status = '1'
where id = #{info.id} where id = #{info.id}
</update> </update>
@ -343,7 +343,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
END isZz, END isZz,
bu.bzz_idcard AS idCard bu.bzz_idcard AS idCard
FROM FROM
back_apply_info bai (select * from back_apply_info
<where>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
and create_time between concat(#{startTime},' 00:00:00') and concat(#{endTime},' 23:59:59')
</if>
</where>
) bai
LEFT JOIN back_check_details bad on bad.parent_id = bai.id LEFT JOIN back_check_details bad on bad.parent_id = bai.id
LEFT JOIN tm_task tt on tt.task_id = bai.task_id LEFT JOIN tm_task tt on tt.task_id = bai.task_id
LEFT JOIN tm_task_agreement tta on tta.task_id = tt.task_id LEFT JOIN tm_task_agreement tta on tta.task_id = tt.task_id
@ -379,9 +385,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="proId != null"> <if test="proId != null">
and bp.pro_id = #{proId} and bp.pro_id = #{proId}
</if> </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( bai.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]> <!-- <![CDATA[and DATE_FORMAT( bai.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>-->
</if> <!-- </if>-->
<if test="appTaskStatus != null and appTaskStatus == 0"> <if test="appTaskStatus != null and appTaskStatus == 0">
and tt.task_status = #{appTaskStatus} and tt.task_status = #{appTaskStatus}
</if> </if>
@ -403,59 +409,59 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getDetailsList" resultType="com.bonus.material.clz.domain.back.MaterialBackApplyInfo"> <select id="getDetailsList" resultType="com.bonus.material.clz.domain.back.MaterialBackApplyInfo">
SELECT SELECT
mt.type_name AS modelCode, mt.type_name AS modelCode,
mt1.type_name AS typeName, mt1.type_name AS typeName,
mt2.type_name AS typeCode, mt2.type_name AS typeCode,
mt.manage_type AS manageType, mt.manage_type AS manageType,
sum(bcd.back_num) AS backNum, sum(bcd.back_num) AS backNum,
mt.unit_name AS unitNames, mt.unit_name AS unitNames,
bcd.remark AS remark bcd.remark AS remark
FROM FROM
back_check_details bcd back_check_details bcd
LEFT JOIN back_apply_info bai ON bcd.parent_id = bai.id LEFT JOIN back_apply_info bai ON bcd.parent_id = bai.id
LEFT JOIN ma_type mt ON mt.type_id = bcd.type_id and mt.del_flag = 0 LEFT JOIN ma_type mt ON mt.type_id = bcd.type_id and mt.del_flag = 0
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id and mt1.del_flag = 0 LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id and mt1.del_flag = 0
LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id and mt2.del_flag = 0 LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id and mt2.del_flag = 0
LEFT JOIN ma_type mt3 ON mt2.parent_id = mt3.type_id and mt3.del_flag = 0 LEFT JOIN ma_type mt3 ON mt2.parent_id = mt3.type_id and mt3.del_flag = 0
WHERE WHERE
bcd.parent_id = #{parentId} bcd.parent_id = #{parentId}
group by bcd.type_id group by bcd.type_id
</select> </select>
<select id="selectBackApplyInfoById" resultType="com.bonus.material.clz.domain.back.MaterialBackApplyInfo"> <select id="selectBackApplyInfoById" resultType="com.bonus.material.clz.domain.back.MaterialBackApplyInfo">
SELECT SELECT
bai.id AS id, bai.id AS id,
bai.CODE AS CODE, bai.CODE AS CODE,
bai.task_id AS taskId, bai.task_id AS taskId,
bai.back_person AS backPerson, bai.back_person AS backPerson,
bai.phone AS phone, bai.phone AS phone,
bai.create_by AS createBy, bai.create_by AS createBy,
bai.create_time AS createTime, bai.create_time AS createTime,
bai.update_by AS updateBy, bai.update_by AS updateBy,
bai.update_time AS updateTime, bai.update_time AS updateTime,
bai.remark AS remark, bai.remark AS remark,
bai.STATUS AS STATUS, bai.STATUS AS STATUS,
bai.print_status AS printStatus, bai.print_status AS printStatus,
ba.agreement_id AS agreementId, ba.agreement_id AS agreementId,
bt.unit_id AS teamId, bt.unit_id AS teamId,
bt.unit_name AS teamName, bt.unit_name AS teamName,
bp.pro_id AS proId, bp.pro_id AS proId,
bp.pro_name AS proName, bp.pro_name AS proName,
bai.direct_audit_by AS directAuditBy, bai.direct_audit_by AS directAuditBy,
bai.back_sign_url AS backSignUrl, bai.back_sign_url AS backSignUrl,
bai.back_sign_type AS backSignType, bai.back_sign_type AS backSignType
bp.external_id AS externalId bp.external_id AS externalId
FROM FROM
clz_back_apply_info bai clz_back_apply_info bai
LEFT JOIN tm_task_agreement tta ON bai.task_id = tta.task_id LEFT JOIN tm_task_agreement tta ON bai.task_id = tta.task_id
LEFT JOIN clz_bm_agreement_info ba ON ba.agreement_id = tta.agreement_id LEFT JOIN clz_bm_agreement_info ba ON ba.agreement_id = tta.agreement_id
AND ba.`status` = 1 AND ba.`status` = 1
LEFT JOIN bm_unit bt ON bt.unit_id = ba.unit_id LEFT JOIN bm_unit bt ON bt.unit_id = ba.unit_id
AND bt.del_flag = '0' AND bt.del_flag = '0'
LEFT JOIN bm_project bp ON ba.project_id = bp.pro_id LEFT JOIN bm_project bp ON ba.project_id = bp.pro_id
AND bp.del_flag = '0' AND bp.del_flag = '0'
WHERE WHERE
bai.id = #{id} bai.id = #{id}
</select> </select>
<select id="selectBackApplyDetailsListByTaskId" resultType="com.bonus.material.clz.domain.back.MaterialBackApplyDetails"> <select id="selectBackApplyDetailsListByTaskId" resultType="com.bonus.material.clz.domain.back.MaterialBackApplyDetails">
@ -499,25 +505,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectByCode" resultType="com.bonus.material.back.domain.vo.MaCodeVo"> <select id="selectByCode" resultType="com.bonus.material.back.domain.vo.MaCodeVo">
SELECT SELECT
bcd.ma_id AS maId, bcd.ma_id AS maId,
mm.ma_code as maCode, mm.ma_code as maCode,
bcd.type_id AS typeId, bcd.type_id AS typeId,
mt2.type_name AS materialType, mt2.type_name AS materialType,
mt.type_name AS typeName, mt.type_name AS typeName,
mt1.type_name AS materialName, mt1.type_name AS materialName,
bcd.ap_detection AS apDetection, bcd.ap_detection AS apDetection,
sd.dict_label AS maStatusName, sd.dict_label AS maStatusName,
bcd.bad_num AS badNum, bcd.bad_num AS badNum,
bcd.good_num AS goodNum, bcd.good_num AS goodNum,
mm.ma_status AS maStatus mm.ma_status AS maStatus
FROM FROM
clz_back_check_details bcd clz_back_check_details bcd
left join ma_machine mm on bcd.ma_id = mm.ma_id left join ma_machine mm on bcd.ma_id = mm.ma_id
left join ma_type mt ON mt.type_id = mm.type_id and mt.del_flag = 0 left join ma_type mt ON mt.type_id = mm.type_id and mt.del_flag = 0
left join ma_type mt1 ON mt.parent_id = mt1.type_id and mt1.del_flag = 0 left join ma_type mt1 ON mt.parent_id = mt1.type_id and mt1.del_flag = 0
left join ma_type mt2 ON mt1.parent_id = mt2.type_id and mt2.del_flag = 0 left join ma_type mt2 ON mt1.parent_id = mt2.type_id and mt2.del_flag = 0
LEFT JOIN sys_dict_data sd ON mm.ma_status = sd.dict_value LEFT JOIN sys_dict_data sd ON mm.ma_status = sd.dict_value
and sd.dict_type = 'ma_machine_status' and sd.dict_type = 'ma_machine_status'
where bcd.parent_id = #{id} where bcd.parent_id = #{id}
</select> </select>
@ -547,27 +553,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getDetailsById" resultType="com.bonus.material.clz.domain.back.MaterialBackApplyDetails"> <select id="getDetailsById" resultType="com.bonus.material.clz.domain.back.MaterialBackApplyDetails">
SELECT SELECT
mt1.type_name as typeName, mt1.type_name as typeName,
mt.type_name as typeModel, mt.type_name as typeModel,
bcd.type_id as typeId, bcd.type_id as typeId,
bcd.back_num as preNum, bcd.back_num as preNum,
bcd.ma_id as maId, bcd.ma_id as maId,
mm.ma_code as maCode, mm.ma_code as maCode,
bcd.parent_id as parentId, bcd.parent_id as parentId,
bcd.create_by as createBy, bcd.create_by as createBy,
bcd.create_time as createTime, bcd.create_time as createTime,
bai.task_id as taskId, bai.task_id as taskId,
bcd.ap_detection as apDetection bcd.ap_detection as apDetection
FROM FROM
clz_back_check_details bcd clz_back_check_details bcd
LEFT JOIN ma_type mt ON bcd.type_id = mt.type_id LEFT JOIN ma_type mt ON bcd.type_id = mt.type_id
AND mt.del_flag = '0' AND mt.del_flag = '0'
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
AND mt1.del_flag = '0' AND mt1.del_flag = '0'
LEFT JOIN ma_machine mm ON bcd.ma_id = mm.ma_id LEFT JOIN ma_machine mm ON bcd.ma_id = mm.ma_id
LEFT JOIN clz_back_apply_info bai ON bcd.parent_id = bai.id LEFT JOIN clz_back_apply_info bai ON bcd.parent_id = bai.id
WHERE WHERE
bcd.parent_id = #{parentId} and bcd.type_id = #{typeId} bcd.parent_id = #{parentId} and bcd.type_id = #{typeId}
</select> </select>
<select id="selectBackDetails" resultType="com.bonus.material.clz.domain.back.MaterialBackApplyInfo"> <select id="selectBackDetails" resultType="com.bonus.material.clz.domain.back.MaterialBackApplyInfo">
@ -629,7 +635,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="getBackInfoDetails" resultType="com.bonus.material.clz.domain.back.MaterialBackApplyTotalInfo"> <select id="getBackInfoDetails" resultType="com.bonus.material.clz.domain.back.MaterialBackApplyTotalInfo">
select select
sd.dept_name AS impUnitName, sd.dept_name AS impUnitName,
bp.pro_center AS departName, bp.pro_center AS departName,
bcd.id AS id, bcd.id AS id,
@ -741,23 +747,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getUseTypeTreeL4" resultType="com.bonus.common.biz.domain.TypeTreeNode"> <select id="getUseTypeTreeL4" resultType="com.bonus.common.biz.domain.TypeTreeNode">
SELECT SELECT
mt.type_id as typeId, mt.type_id as typeId,
mt1.type_name as materialName, mt1.type_name as materialName,
mt.type_name as typeName, mt.type_name as typeName,
mt.parent_id as parentId, mt.parent_id as parentId,
mt.unit_name as unitName, mt.unit_name as unitName,
mt.unit_value as unitValue, mt.unit_value as unitValue,
mt.manage_type as manageType, mt.manage_type as manageType,
SUM(sai.num) AS num, SUM(sai.num) AS num,
mt.LEVEL as level, mt.LEVEL as level,
clai.lease_style as leaseStyle clai.lease_style as leaseStyle
FROM FROM
ma_type mt ma_type mt
LEFT JOIN clz_slt_agreement_info sai ON mt.type_id = sai.type_id LEFT JOIN clz_slt_agreement_info sai ON mt.type_id = sai.type_id
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id and mt1.del_flag = '0' LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id and mt1.del_flag = '0'
LEFT JOIN clz_lease_apply_info clai ON sai.lease_id = clai.id LEFT JOIN clz_lease_apply_info clai ON sai.lease_id = clai.id
WHERE WHERE
sai.STATUS = '0' sai.STATUS = '0'
<if test="agreementIds != null "> <if test="agreementIds != null ">
and sai.agreement_id in and sai.agreement_id in
@ -767,35 +773,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
GROUP BY GROUP BY
mt.type_id mt.type_id
</select> </select>
<select id="getMachineById" resultType="com.bonus.material.clz.domain.vo.MaterialMaCodeVo"> <select id="getMachineById" resultType="com.bonus.material.clz.domain.vo.MaterialMaCodeVo">
SELECT SELECT
mm.ma_id AS maId, mm.ma_id AS maId,
mm.ma_code AS maCode, mm.ma_code AS maCode,
'在用' AS maStatusName, '在用' AS maStatusName,
mt1.type_name AS materialName, mt1.type_name AS materialName,
mt.type_id AS typeId, mt.type_id AS typeId,
mt.type_name AS typeName, mt.type_name AS typeName,
mt2.type_name AS materialType mt2.type_name AS materialType
FROM FROM
clz_lease_out_details lod clz_lease_out_details lod
LEFT JOIN ma_machine mm ON lod.ma_id = mm.ma_id LEFT JOIN ma_machine mm ON lod.ma_id = mm.ma_id
LEFT JOIN ma_type mt ON lod.type_id = mt.type_id LEFT JOIN ma_type mt ON lod.type_id = mt.type_id
AND mt.del_flag = '0' AND mt.del_flag = '0'
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
AND mt1.del_flag = '0' AND mt1.del_flag = '0'
LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id
AND mt2.del_flag = '0' AND mt2.del_flag = '0'
LEFT JOIN clz_slt_agreement_info sai on lod.type_id = sai.type_id LEFT JOIN clz_slt_agreement_info sai on lod.type_id = sai.type_id
and sai.ma_id = lod.ma_id and sai.ma_id = lod.ma_id
LEFT JOIN clz_bm_agreement_info ba ON sai.agreement_id = ba.agreement_id LEFT JOIN clz_bm_agreement_info ba ON sai.agreement_id = ba.agreement_id
WHERE WHERE
sai.status = '0' sai.status = '0'
AND mt.type_id = #{typeId} AND mt.type_id = #{typeId}
AND ba.unit_id = #{teamId} AND ba.unit_id = #{teamId}
AND ba.project_id = #{proId} AND ba.project_id = #{proId}
<if test="maCode != null and maCode != ''"> <if test="maCode != null and maCode != ''">
AND mm.ma_code LIKE CONCAT(CONCAT('%', #{maCode}), '%') AND mm.ma_code LIKE CONCAT(CONCAT('%', #{maCode}), '%')
</if> </if>
@ -804,28 +810,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectAgreementId" resultType="java.lang.Long"> <select id="selectAgreementId" resultType="java.lang.Long">
SELECT SELECT
tt.agreement_id AS agreementId tt.agreement_id AS agreementId
FROM FROM
clz_back_apply_info ba clz_back_apply_info ba
LEFT JOIN tm_task_agreement tt ON ba.task_id = tt.task_id LEFT JOIN tm_task_agreement tt ON ba.task_id = tt.task_id
WHERE WHERE
ba.id = #{id} ba.id = #{id}
</select> </select>
<select id="selectByAgreementIdAndTypeIdAndMaId" resultType="com.bonus.material.clz.domain.back.MaterialBackApplyInfo"> <select id="selectByAgreementIdAndTypeIdAndMaId" resultType="com.bonus.material.clz.domain.back.MaterialBackApplyInfo">
SELECT SELECT
agreement_id AS agreementId, agreement_id AS agreementId,
type_id AS typeId, type_id AS typeId,
ma_id AS maId ma_id AS maId
FROM FROM
clz_slt_agreement_info clz_slt_agreement_info
WHERE WHERE
status = '0' status = '0'
AND agreement_id = #{agreementId} AND agreement_id = #{agreementId}
AND type_id = #{typeId} AND type_id = #{typeId}
<if test="maId != null"> <if test="maId != null">
AND ma_id = #{maId} AND ma_id = #{maId}
</if> </if>
</select> </select>
<select id="selectByAgreementIdAndTypeId" resultType="com.bonus.material.clz.domain.back.MaterialBackApplyInfo"> <select id="selectByAgreementIdAndTypeId" resultType="com.bonus.material.clz.domain.back.MaterialBackApplyInfo">
@ -892,26 +898,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="getAgreementInfo" resultType="com.bonus.material.clz.domain.back.MaterialBackApplyInfo"> <select id="getAgreementInfo" resultType="com.bonus.material.clz.domain.back.MaterialBackApplyInfo">
select select
csa.unit_id AS teamId, csa.unit_id AS teamId,
csa.project_id AS proId csa.project_id AS proId
from from
tm_task_agreement tta tm_task_agreement tta
LEFT JOIN clz_bm_agreement_info csa ON tta.agreement_id = csa.agreement_id LEFT JOIN clz_bm_agreement_info csa ON tta.agreement_id = csa.agreement_id
WHERE tta.task_id = #{taskId} WHERE tta.task_id = #{taskId}
</select> </select>
<select id="getAgreementList" resultType="java.lang.String"> <select id="getAgreementList" resultType="java.lang.String">
select csa.agreement_id AS agreementId select csa.agreement_id AS agreementId
from clz_bm_agreement_info csa from clz_bm_agreement_info csa
where csa.unit_id = #{teamId} where csa.unit_id = #{teamId}
and csa.project_id = #{proId} and csa.project_id = #{proId}
</select> </select>
<select id="getLeaseAgreement" resultType="java.lang.String"> <select id="getLeaseAgreement" resultType="java.lang.String">
select csa.agreement_id AS agreementId select csa.agreement_id AS agreementId
from clz_bm_agreement_info csa from clz_bm_agreement_info csa
where csa.unit_id = #{teamId} where csa.unit_id = #{teamId}
and csa.project_id = #{proId} and csa.project_id = #{proId}
Limit 1 Limit 1
</select> </select>
<select id="getLeaseOutSignList" resultType="com.bonus.common.biz.domain.lease.LeaseOutSign"> <select id="getLeaseOutSignList" resultType="com.bonus.common.biz.domain.lease.LeaseOutSign">

View File

@ -1173,15 +1173,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
GROUP BY bzgl_bz.bzmc GROUP BY bzgl_bz.bzmc
</select> </select>
<select id="getUnsettledProId" resultType="java.lang.String"> <select id="getUnsettledProId" resultType="java.lang.String">
SELECT DISTINCT bp.pro_id as proId <!-- 数据量小的时候用上面的SQL数据量大的时候用下面的sql -->
SELECT bp.pro_id as proId
FROM bm_project bp FROM bm_project bp
WHERE EXISTS( WHERE bp.pro_id IS NOT NULL
SELECT 1 AND bp.pro_id IN (
FROM bm_agreement_info bai SELECT bai.project_id
INNER JOIN slt_agreement_info sai ON bai.agreement_id = sai.agreement_id FROM bm_agreement_info bai
WHERE bai.project_id = bp.pro_id INNER JOIN slt_agreement_info sai ON bai.agreement_id = sai.agreement_id
AND sai.is_slt = 0 WHERE sai.is_slt = 0
) )
AND bp.pro_id IS NOT NULL <!-- SELECT DISTINCT bp.pro_id as proId-->
<!-- FROM bm_project bp-->
<!-- WHERE EXISTS(-->
<!-- SELECT 1-->
<!-- FROM bm_agreement_info bai-->
<!-- INNER JOIN slt_agreement_info sai ON bai.agreement_id = sai.agreement_id-->
<!-- WHERE bai.project_id = bp.pro_id-->
<!-- AND sai.is_slt = 0-->
<!-- )-->
<!-- AND bp.pro_id IS NOT NULL-->
</select> </select>
</mapper> </mapper>

View File

@ -331,21 +331,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-- 第一个查询(时间条件:小于 2025-08-20 -- 第一个查询(时间条件:小于 2025-08-20
SELECT DISTINCT SELECT DISTINCT
tk.task_id AS taskId, tk.task_id AS taskId,
tk.CODE AS scrapNum,
tt2.CODE AS repairTaskCode,
tk.task_status AS taskStatus,
bui.unit_name AS unitName, bui.unit_name AS unitName,
bpl.pro_name AS projectName, bpl.pro_name AS projectName,
su.nick_name AS createBy, tk.CODE as auditCode,
tk.create_time AS createTime, tt3.`code` as backCode,
tk.remark, GROUP_CONCAT(DISTINCT mt1.type_name) AS typeName2,
tk.CODE AS repairNum, rn.scrapNum AS scrapNum3,
rad.audit_time as auditTime, rn.repairNum as repairNum2,
GROUP_CONCAT(DISTINCT mt4.type_id) AS firstId rn.repairedNum as repairedNum,
tk.task_status AS taskStatus,
rad.create_by AS createBy2,
rad.create_time AS auditTime
FROM FROM
tm_task tk tm_task tk
LEFT JOIN tm_task tt ON tk.pre_task_id = tt.task_id
LEFT JOIN repair_audit_details rad ON tk.task_id = rad.task_id LEFT JOIN repair_audit_details rad ON tk.task_id = rad.task_id
LEFT JOIN (
SELECT
rad.task_id,
SUM(rad.scrap_num) AS scrapNum,
SUM(rad.repair_num) as repairNum,
SUM(rad.repaired_num) as repairedNum
from repair_audit_details rad
<if test="userId != null">
JOIN ma_type_repair mtr ON mtr.type_id = rad.type_id AND mtr.user_id = #{userId}
</if>
GROUP BY rad.task_id
) rn on rn.task_id = tk.task_id
LEFT JOIN repair_apply_details raad on raad.task_id = rad.repair_id
LEFT JOIN tm_task tt3 on tt3.task_id = raad.back_id
LEFT JOIN tm_task tt2 ON tt2.task_id = rad.repair_id LEFT JOIN tm_task tt2 ON tt2.task_id = rad.repair_id
LEFT JOIN tm_task_agreement tta ON rad.repair_id = tta.task_id LEFT JOIN tm_task_agreement tta ON rad.repair_id = tta.task_id
LEFT JOIN bm_agreement_info bai ON tta.agreement_id = bai.agreement_id LEFT JOIN bm_agreement_info bai ON tta.agreement_id = bai.agreement_id
@ -354,10 +367,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN ma_type mt ON rad.type_id = mt.type_id LEFT JOIN ma_type mt ON rad.type_id = mt.type_id
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
LEFT JOIN sys_user su ON su.user_id = tk.create_by LEFT JOIN sys_user su ON su.user_id = tk.create_by
LEFT JOIN ma_type mt3 ON mt1.parent_id = mt3.type_id AND mt3.del_flag = '0' LEFT JOIN ma_type mt3 ON mt1.parent_id = mt3.type_id
LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id AND mt4.del_flag = '0' AND mt3.del_flag = '0'
LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id
AND mt4.del_flag = '0'
<if test="userId != null"> <if test="userId != null">
JOIN ma_type_repair mtr ON mtr.type_id = rad.type_id AND mtr.user_id = #{userId} JOIN ma_type_repair mtr ON mtr.type_id = rad.type_id AND mtr.user_id = #{userId}
</if> </if>
WHERE WHERE
tk.task_type = #{taskType} and tt2.CODE is not null tk.task_type = #{taskType} and tt2.CODE is not null
@ -388,41 +403,54 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
GROUP BY GROUP BY
tk.CODE tk.CODE
UNION UNION
-- 第二个查询(时间条件:>= 2025-08-20 -- 第二个查询(时间条件:>= 2025-08-20
SELECT DISTINCT SELECT DISTINCT
tk.task_id AS taskId, tk.task_id AS taskId,
tk.CODE AS scrapNum,
tt.CODE AS repairTaskCode,
tk.task_status AS taskStatus,
bui.unit_name AS unitName, bui.unit_name AS unitName,
bpl.pro_name AS projectName, bpl.pro_name AS projectName,
su.nick_name AS createBy, tk.CODE as auditCode,
tk.create_time AS createTime, baii.`code` as backCode,
tk.remark, GROUP_CONCAT(DISTINCT mt1.type_name) AS typeName2,
tk.CODE AS repairNum, rn.scrapNum AS scrapNum3,
rad.audit_time as auditTime, rn.repairNum as repairNum2,
GROUP_CONCAT(DISTINCT mt4.type_id) AS firstId rn.repairedNum as repairedNum,
tk.task_status AS taskStatus,
su.nick_name AS createBy2,
rad.audit_time AS auditTime
FROM FROM
tm_task tk tm_task tk
LEFT JOIN tm_task tt ON tk.pre_task_id = tt.task_id LEFT JOIN (
SELECT
rad.task_id,
SUM(rad.scrap_num) AS scrapNum,
SUM(rad.repair_num) as repairNum,
SUM(rad.repaired_num) as repairedNum,
rad.audit_time
from repair_audit_details rad
<if test="userId != null">
JOIN ma_type_repair mtr ON mtr.type_id = rad.type_id AND mtr.user_id = #{userId}
</if>
GROUP BY rad.task_id
) rn on rn.task_id = tk.task_id
LEFT JOIN repair_audit_details rad ON tk.task_id = rad.task_id
LEFT JOIN back_apply_info baii on baii.id = rad.back_id
LEFT JOIN tm_task_agreement tta ON tk.task_id = tta.task_id LEFT JOIN tm_task_agreement tta ON tk.task_id = tta.task_id
LEFT JOIN bm_agreement_info bai ON tta.agreement_id = bai.agreement_id LEFT JOIN bm_agreement_info bai ON tta.agreement_id = bai.agreement_id
LEFT JOIN bm_project bpl ON bai.project_id = bpl.pro_id LEFT JOIN bm_project bpl ON bai.project_id = bpl.pro_id
LEFT JOIN bm_unit bui ON bai.unit_id = bui.unit_id LEFT JOIN bm_unit bui ON bai.unit_id = bui.unit_id
LEFT JOIN repair_audit_details rad ON tk.task_id = rad.task_id
LEFT JOIN ma_type mt ON rad.type_id = mt.type_id LEFT JOIN ma_type mt ON rad.type_id = mt.type_id
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
LEFT JOIN sys_user su ON su.user_id = tk.create_by LEFT JOIN sys_user su ON su.user_id = tk.create_by
LEFT JOIN ma_type mt3 ON mt1.parent_id = mt3.type_id AND mt3.del_flag = '0' LEFT JOIN ma_type mt3 ON mt1.parent_id = mt3.type_id
LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id AND mt4.del_flag = '0' AND mt3.del_flag = '0'
LEFT JOIN ma_type mt4 ON mt3.parent_id = mt4.type_id
AND mt4.del_flag = '0'
<if test="userId != null"> <if test="userId != null">
JOIN ma_type_repair mtr ON mtr.type_id = rad.type_id AND mtr.user_id = #{userId} JOIN ma_type_repair mtr ON mtr.type_id = rad.type_id AND mtr.user_id = #{userId}
</if> </if>
WHERE WHERE
tk.task_type = #{taskType} and tt.CODE is not null tk.task_type = #{taskType}
AND tk.create_time &gt;= '2025-08-20 00:00:00' AND tk.create_time &gt;= '2025-08-20 00:00:00'
<if test="backUnit != null and backUnit != ''"> <if test="backUnit != null and backUnit != ''">
AND bui.unit_id = #{backUnit} AND bui.unit_id = #{backUnit}
@ -458,7 +486,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<otherwise> <otherwise>
ORDER BY ORDER BY
taskStatus, taskStatus,
createTime DESC auditTime DESC
</otherwise> </otherwise>
</choose> </choose>
</select> </select>

View File

@ -336,40 +336,32 @@
<select id="exportRepairTaskList" resultType="com.bonus.material.repair.domain.RepairTask"> <select id="exportRepairTaskList" resultType="com.bonus.material.repair.domain.RepairTask">
SELECT SELECT
rd.task_id, bui.unit_name AS backUnit,
tt.CODE AS repairCode, bpi.pro_name AS backPro,
bui.unit_name AS backUnit, tt.CODE AS repairCode,
bpi.pro_name AS backPro, bai.CODE AS backCode,
su.nick_name AS createName, mt2.type_name AS type,
tt.create_time AS createTime, mt.type_name AS typeName,
bai.CODE AS backCode, rd.repair_num AS returnNum,
tt.task_status AS repairStatusCode, rd.repaired_num AS repairNum,
tt.company_id AS companyId, rd.repair_num - rd.repaired_num as beRepairedNum,
mt2.type_name AS type, rd.scrap_num AS scrapNum,
mt.type_name AS typeName, rd.create_by AS createName,
mm.ma_code AS CODE, tt.create_time AS createTime
rd.repair_num AS repairNum,
rd.repaired_num AS repairedNum,
rd.scrap_num AS scrapNum,
case rd.status when '0' then '未完成' when '1' then '已完成' else '' end as status,
su2.nick_name as repairer,
rd.update_time as updateTime
FROM FROM
repair_apply_details rd repair_apply_details rd
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 back_apply_info bai ON rd.back_id = bai.id LEFT JOIN back_apply_info bai ON rd.back_id = bai.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
LEFT JOIN bm_unit bui ON bai2.unit_id = bui.unit_id LEFT JOIN bm_unit bui ON bai2.unit_id = bui.unit_id
LEFT JOIN bm_project bpi ON bai2.project_id = bpi.pro_id and bpi.del_flag = '0' LEFT JOIN bm_project bpi ON bai2.project_id = bpi.pro_id
LEFT JOIN sys_user su ON rd.create_by = su.user_id AND bpi.del_flag = '0'
left join sys_user su2 on rd.repairer = su2.user_id
LEFT JOIN ma_machine mm ON mm.ma_id = rd.ma_id
where 1=1 where 1=1
<if test="keyWord != null and keyWord != ''"> <if test="keyWord != null and keyWord != ''">
AND (locate(#{keyWord}, su.nick_name) > 0 AND (locate(#{keyWord}, rd.create_by) > 0
or locate(#{keyWord}, tt.CODE) > 0) or locate(#{keyWord}, tt.CODE) > 0)
</if> </if>
<if test="backUnit != null and backUnit != ''"> <if test="backUnit != null and backUnit != ''">