Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
81ce2a56bb
|
|
@ -158,10 +158,10 @@ public interface BackApplyInfoMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询详情
|
* 查询详情
|
||||||
* @param id
|
* @param backApplyInfo
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<BackApplyInfo> selectBackDetails(Long id);
|
List<BackApplyInfo> selectBackDetails(BackApplyInfo backApplyInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新任务状态
|
* 更新任务状态
|
||||||
|
|
|
||||||
|
|
@ -556,7 +556,7 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public AjaxResult submitBackApply(BackApplyInfo backApplyInfo) {
|
public AjaxResult submitBackApply(BackApplyInfo backApplyInfo) {
|
||||||
// 根据传入的id查询退料申请信息
|
// 根据传入的id查询退料申请信息
|
||||||
List<BackApplyInfo> applyInfoList = backApplyInfoMapper.selectBackDetails(backApplyInfo.getId());
|
List<BackApplyInfo> applyInfoList = backApplyInfoMapper.selectBackDetails(backApplyInfo);
|
||||||
// 设置更新信息
|
// 设置更新信息
|
||||||
backApplyInfo.setUpdateBy(SecurityUtils.getUsername());
|
backApplyInfo.setUpdateBy(SecurityUtils.getUsername());
|
||||||
backApplyInfo.setUpdateTime(DateUtils.getNowDate());
|
backApplyInfo.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
|
@ -564,23 +564,30 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
// 更新任务表及退料申请表状态
|
// 更新任务表及退料申请表状态
|
||||||
int result = updateTaskAndBackInfo(backApplyInfo);
|
int result = updateTaskAndBackInfo(backApplyInfo);
|
||||||
if (result > 0 && CollectionUtils.isNotEmpty(applyInfoList)) {
|
if (result > 0 && CollectionUtils.isNotEmpty(applyInfoList)) {
|
||||||
for (BackApplyInfo applyInfo : applyInfoList) {
|
// 获取applyInfoList的typeId并生成集合
|
||||||
// 查询待维修的机具设备
|
List<String> typeIdList = applyInfoList.stream()
|
||||||
backApplyInfo.setTypeId(applyInfo.getTypeId());
|
.map(BackApplyInfo::getTypeId).distinct()
|
||||||
List<BackApplyInfo> wxList = backApplyInfoMapper.getWxList(backApplyInfo);
|
.collect(Collectors.toList());
|
||||||
if (CollectionUtils.isNotEmpty(wxList)) {
|
|
||||||
// 插入任务表
|
// 插入任务表
|
||||||
Long newTaskId = insertTt(SecurityUtils.getUsername());
|
Long newTaskId = insertTt(SecurityUtils.getUsername());
|
||||||
// 插入协议任务表
|
// 插入协议任务表
|
||||||
result += insertTta(newTaskId, wxList);
|
result += insertTta(newTaskId, applyInfoList);
|
||||||
|
for (String typeId : typeIdList) {
|
||||||
|
// 查询待维修的机具设备
|
||||||
|
backApplyInfo.setTypeId(typeId);
|
||||||
|
List<BackApplyInfo> wxList = backApplyInfoMapper.getWxList(backApplyInfo);
|
||||||
|
if (CollectionUtils.isNotEmpty(wxList)) {
|
||||||
// 插入维修记录表
|
// 插入维修记录表
|
||||||
result += insertRad(newTaskId, wxList);
|
result += insertRad(newTaskId, wxList);
|
||||||
// 更新结算表
|
// 更新结算表
|
||||||
int res = updateSlt4Bean(backApplyInfo, applyInfo);
|
List<BackApplyInfo> allList = backApplyInfoMapper.selectBackDetails(backApplyInfo);
|
||||||
|
if (CollectionUtils.isNotEmpty(allList)) {
|
||||||
|
int res = updateSlt4Bean(backApplyInfo, allList);
|
||||||
// 检查机具是否领料
|
// 检查机具是否领料
|
||||||
if (res == 0) {
|
if (res == 0) {
|
||||||
throw new RuntimeException("该机具未被领料使用");
|
throw new RuntimeException("该机具未被领料使用");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// 完成退料部分,更新 back_check_details
|
// 完成退料部分,更新 back_check_details
|
||||||
finishBackCheckDetails(backApplyInfo);
|
finishBackCheckDetails(backApplyInfo);
|
||||||
}
|
}
|
||||||
|
|
@ -620,10 +627,11 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
/**
|
/**
|
||||||
* 更新结算表
|
* 更新结算表
|
||||||
* @param record
|
* @param record
|
||||||
* @param bean
|
* @param allList
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private int updateSlt4Bean(BackApplyInfo record, BackApplyInfo bean) {
|
private int updateSlt4Bean(BackApplyInfo record, List<BackApplyInfo> allList) {
|
||||||
|
for (BackApplyInfo bean : allList) {
|
||||||
List<SltAgreementInfo> infoList = backApplyInfoMapper.getStlInfo(bean);
|
List<SltAgreementInfo> infoList = backApplyInfoMapper.getStlInfo(bean);
|
||||||
if (infoList.size() > 0) {
|
if (infoList.size() > 0) {
|
||||||
Integer backNum = bean.getBackNum();
|
Integer backNum = bean.getBackNum();
|
||||||
|
|
@ -645,6 +653,7 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -142,6 +142,11 @@ public class PurchaseCheckDetails extends BaseEntity {
|
||||||
@ApiModelProperty(value = "是否是固定资产编号(0 否,1 是)")
|
@ApiModelProperty(value = "是否是固定资产编号(0 否,1 是)")
|
||||||
private String fixCode;
|
private String fixCode;
|
||||||
|
|
||||||
|
/** 管理方式(0编号 1计数) */
|
||||||
|
@Excel(name = "管理方式(0编号 1计数)")
|
||||||
|
@ApiModelProperty(value = "管理方式(0编号 1计数)")
|
||||||
|
private Integer manageType;
|
||||||
|
|
||||||
/** 验收附件列表 */
|
/** 验收附件列表 */
|
||||||
//@Excel(name = "验收附件列表")
|
//@Excel(name = "验收附件列表")
|
||||||
@ApiModelProperty(value = "验收附件列表")
|
@ApiModelProperty(value = "验收附件列表")
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import java.util.concurrent.atomic.AtomicLong;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import com.bonus.common.biz.constant.BmConfigItems;
|
import com.bonus.common.biz.constant.BmConfigItems;
|
||||||
|
import com.bonus.common.biz.enums.MaTypeManageTypeEnum;
|
||||||
import com.bonus.common.biz.enums.PurchaseTaskStatusEnum;
|
import com.bonus.common.biz.enums.PurchaseTaskStatusEnum;
|
||||||
import com.bonus.common.biz.enums.TmTaskTypeEnum;
|
import com.bonus.common.biz.enums.TmTaskTypeEnum;
|
||||||
import com.bonus.common.core.exception.ServiceException;
|
import com.bonus.common.core.exception.ServiceException;
|
||||||
|
|
@ -100,6 +101,9 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
||||||
boolean isAllowPartTransfer = bmConfigService.isBmConfigEnabledWithDefaultFalse(BmConfigItems.BOOLEAN_ALLOW_PURCHASE_PART_TRANSFER);
|
boolean isAllowPartTransfer = bmConfigService.isBmConfigEnabledWithDefaultFalse(BmConfigItems.BOOLEAN_ALLOW_PURCHASE_PART_TRANSFER);
|
||||||
for (PurchaseCheckInfo purchaseInfo : purchaseCheckInfos) {
|
for (PurchaseCheckInfo purchaseInfo : purchaseCheckInfos) {
|
||||||
List<PurchaseCheckDetails> purchaseCheckDetails = purchaseCheckDetailsMapper.selectPurchaseCheckDetailsListByTaskId(purchaseInfo.getTaskId(), null);
|
List<PurchaseCheckDetails> purchaseCheckDetails = purchaseCheckDetailsMapper.selectPurchaseCheckDetailsListByTaskId(purchaseInfo.getTaskId(), null);
|
||||||
|
// 筛除:绑定状态 + 数量设备
|
||||||
|
purchaseCheckDetails = purchaseCheckDetails.stream().filter(o -> !(MaTypeManageTypeEnum.NUMBER_DEVICE.getTypeId().equals(o.getManageType()) &&
|
||||||
|
(o.getStatus().equals(PurchaseTaskStatusEnum.TO_BIND.getStatus()) || o.getStatus().equals(PurchaseTaskStatusEnum.TO_BIND_AFTER_REJECT.getStatus())))).collect(Collectors.toList());
|
||||||
OptionalInt minStatus = purchaseCheckDetails.stream().mapToInt(PurchaseCheckDetails::getStatus).min();
|
OptionalInt minStatus = purchaseCheckDetails.stream().mapToInt(PurchaseCheckDetails::getStatus).min();
|
||||||
OptionalInt maxStatus = purchaseCheckDetails.stream().mapToInt(PurchaseCheckDetails::getStatus).max();
|
OptionalInt maxStatus = purchaseCheckDetails.stream().mapToInt(PurchaseCheckDetails::getStatus).max();
|
||||||
if (isAllowPartTransfer) {
|
if (isAllowPartTransfer) {
|
||||||
|
|
@ -235,19 +239,35 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
||||||
try {
|
try {
|
||||||
AjaxResult result = new AjaxResult();
|
AjaxResult result = new AjaxResult();
|
||||||
purchaseDto.getTaskIds().removeIf(Objects::isNull);
|
purchaseDto.getTaskIds().removeIf(Objects::isNull);
|
||||||
|
int updateCount = 0;
|
||||||
for (Long taskId : purchaseDto.getTaskIds()) {
|
for (Long taskId : purchaseDto.getTaskIds()) {
|
||||||
boolean updateResult = tmTaskMapper.updateTmTaskStatusByTaskId(taskId,
|
PurchaseQueryDto purchaseQueryDto = new PurchaseQueryDto();
|
||||||
purchaseDto.getStatus()
|
purchaseQueryDto.setTaskId(taskId);
|
||||||
) > 0;
|
List<PurchaseCheckDetails> purchaseCheckDetails = purchaseCheckDetailsMapper.selectPurchaseCheckDetailsListByQueryDto(purchaseQueryDto);
|
||||||
if (updateResult) {
|
List<PurchaseCheckDetails> codeList = purchaseCheckDetails.stream().filter(o -> MaTypeManageTypeEnum.CODE_DEVICE.getTypeId().equals(o.getManageType())).collect(Collectors.toList());
|
||||||
result = purchaseCheckDetailsMapper.batchUpdateDetailsTaskStatus(taskId,
|
List<PurchaseCheckDetails> numList = purchaseCheckDetails.stream().filter(o -> MaTypeManageTypeEnum.NUMBER_DEVICE.getTypeId().equals(o.getManageType())).collect(Collectors.toList());
|
||||||
purchaseDto.getStatus(), purchaseDto.getCheckResult()
|
if (!CollectionUtils.isEmpty(codeList) && codeList.size() > 0) {
|
||||||
) > 0 ? AjaxResult.success("验收状态更改成功") : AjaxResult.error("验收状态更改失败");
|
for (PurchaseCheckDetails details : codeList) {
|
||||||
} else {
|
details.setStatus(PurchaseTaskStatusEnum.TO_BIND.getStatus());
|
||||||
result = AjaxResult.error("SQL未报错,但修改任务0条");
|
updateCount += purchaseCheckDetailsMapper.updatePurchaseDetails(details);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
if (!CollectionUtils.isEmpty(numList) && numList.size() > 0) {
|
||||||
|
for (PurchaseCheckDetails details : numList) {
|
||||||
|
details.setStatus(PurchaseTaskStatusEnum.TO_STORE.getStatus());
|
||||||
|
updateCount += purchaseCheckDetailsMapper.updatePurchaseDetails(details);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// // 维护tm_task的状态,但因为新购任务中的物资可以部分流转,所以汇总的状态失去意义,不再维护
|
||||||
|
// if (!CollectionUtils.isEmpty(codeList) && codeList.size() > 0) {
|
||||||
|
// int taskCount = tmTaskMapper.updateTmTaskStatusByTaskId(taskId, PurchaseTaskStatusEnum.TO_BIND.getStatus());
|
||||||
|
// result = taskCount > 0 ? AjaxResult.success("task绑定状态更改成功") : AjaxResult.error("task绑定状态更改失败");
|
||||||
|
// } if (!CollectionUtils.isEmpty(numList) && numList.size() > 0) {
|
||||||
|
// int taskCount = tmTaskMapper.updateTmTaskStatusByTaskId(taskId, PurchaseTaskStatusEnum.TO_STORE.getStatus());
|
||||||
|
// result = taskCount > 0 ? AjaxResult.success("task待入库状态更改成功") : AjaxResult.error("task待入库状态更改失败");
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
return updateCount > 0 ? AjaxResult.success("验证成功") : AjaxResult.error("无验证信息");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return AjaxResult.error("验收状态更改失败,异常报错:" + e.getMessage());
|
return AjaxResult.error("验收状态更改失败,异常报错:" + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
@ -260,15 +280,25 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
||||||
AjaxResult result = new AjaxResult();
|
AjaxResult result = new AjaxResult();
|
||||||
if (!CollectionUtils.isEmpty(purchaseCheckDetailsList)) {
|
if (!CollectionUtils.isEmpty(purchaseCheckDetailsList)) {
|
||||||
Long taskId = purchaseCheckDetailsList.get(0).getTaskId();
|
Long taskId = purchaseCheckDetailsList.get(0).getTaskId();
|
||||||
Integer status = purchaseCheckDetailsList.get(0).getStatus();
|
//Integer status = purchaseCheckDetailsList.get(0).getStatus();
|
||||||
for (PurchaseCheckDetails details : purchaseCheckDetailsList) {
|
for (PurchaseCheckDetails details : purchaseCheckDetailsList) {
|
||||||
result = purchaseCheckDetailsMapper.updatePurchaseDetails(details) > 0 ? AjaxResult.success("details验收状态更改成功") : AjaxResult.error("details验收状态更改失败");
|
if (MaTypeManageTypeEnum.CODE_DEVICE.getTypeId().equals(details.getManageType())) {
|
||||||
|
details.setStatus(PurchaseTaskStatusEnum.TO_BIND.getStatus());
|
||||||
|
} else if (MaTypeManageTypeEnum.NUMBER_DEVICE.getTypeId().equals(details.getManageType())) {
|
||||||
|
details.setStatus(PurchaseTaskStatusEnum.TO_STORE.getStatus());
|
||||||
}
|
}
|
||||||
//查询是否这个taskId是否已全部验收通过,如果是的,更新整个task的任务状态
|
result = purchaseCheckDetailsMapper.updatePurchaseDetails(details) > 0 ? AjaxResult.success("detail验证成功") : AjaxResult.error("details无验证信息");
|
||||||
int count = purchaseCheckDetailsMapper.getCountOfNoneThisStatus(taskId, status);
|
|
||||||
if (count == 0) {
|
|
||||||
result = tmTaskMapper.updateTmTaskStatusByTaskId(taskId, status) > 0 ? AjaxResult.success("task验收状态更改成功") : AjaxResult.error("task验收状态更改失败");
|
|
||||||
}
|
}
|
||||||
|
// // 维护tm_task的状态,但因为新购任务中的物资可以部分流转,所以汇总的状态失去意义,不再维护
|
||||||
|
// int count = purchaseCheckDetailsMapper.getCountOfNoneThisStatus(taskId, PurchaseTaskStatusEnum.TO_CHECK.getStatus());
|
||||||
|
// if (count == 0) {
|
||||||
|
// int toCheckCount = purchaseCheckDetailsMapper.getCountOfNoneThisStatus(taskId, PurchaseTaskStatusEnum.TO_BIND.getStatus());
|
||||||
|
// if (toCheckCount == 0) {
|
||||||
|
// result = tmTaskMapper.updateTmTaskStatusByTaskId(taskId, PurchaseTaskStatusEnum.TO_STORE.getStatus()) > 0 ? AjaxResult.success("task待入库状态更改成功") : AjaxResult.error("task待入库状态更改失败");
|
||||||
|
// } else {
|
||||||
|
// result = tmTaskMapper.updateTmTaskStatusByTaskId(taskId, PurchaseTaskStatusEnum.TO_BIND.getStatus()) > 0 ? AjaxResult.success("task绑定状态更改成功") : AjaxResult.error("task绑定状态更改失败");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
||||||
|
|
@ -77,9 +77,9 @@ public class RepairController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取维修任务物资设备列表
|
* 获取维修任务物资设备列表--不分页
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "获取维修物资设备列表")
|
@ApiOperation(value = "获取维修物资设备列表---分页")
|
||||||
@GetMapping("/getRepairMaTypeList")
|
@GetMapping("/getRepairMaTypeList")
|
||||||
@RequiresPermissions("repair:manage:preview")
|
@RequiresPermissions("repair:manage:preview")
|
||||||
public TableDataInfo getRepairMaTypeList(RepairTaskDetails bean) {
|
public TableDataInfo getRepairMaTypeList(RepairTaskDetails bean) {
|
||||||
|
|
@ -91,7 +91,7 @@ public class RepairController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 获取维修任务机具列表
|
* 获取维修任务机具列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "获取维修任务机具列表")
|
@ApiOperation(value = "获取维修物资设备列表---不分页")
|
||||||
@GetMapping("/getAppRepairMaTypeList")
|
@GetMapping("/getAppRepairMaTypeList")
|
||||||
public AjaxResult getAppRepairMaTypeList(RepairTaskDetails bean) {
|
public AjaxResult getAppRepairMaTypeList(RepairTaskDetails bean) {
|
||||||
List<RepairTaskDetails> list = service.getRepairMaTypeList(bean);
|
List<RepairTaskDetails> list = service.getRepairMaTypeList(bean);
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,12 @@ public class RepairAuditDetails extends BaseEntity {
|
||||||
@ApiModelProperty(value = "规格ID")
|
@ApiModelProperty(value = "规格ID")
|
||||||
private Long typeId;
|
private Long typeId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "规格型号")
|
||||||
|
private String specificationType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "机具类型名称")
|
||||||
|
private String machineTypeName;
|
||||||
|
|
||||||
/** 维修总量 */
|
/** 维修总量 */
|
||||||
@Excel(name = "维修总量")
|
@Excel(name = "维修总量")
|
||||||
@ApiModelProperty(value = "维修总量")
|
@ApiModelProperty(value = "维修总量")
|
||||||
|
|
|
||||||
|
|
@ -147,4 +147,6 @@ public class RepairTask {
|
||||||
@ApiModelProperty(value = "导出选中列表")
|
@ApiModelProperty(value = "导出选中列表")
|
||||||
private List<Long> dataCondition;
|
private List<Long> dataCondition;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ public class RepairTaskDetails extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "id")
|
@ApiModelProperty(value = "id")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务ID
|
* 任务ID
|
||||||
*/
|
*/
|
||||||
|
|
@ -38,6 +39,13 @@ public class RepairTaskDetails extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "规格型号")
|
@ApiModelProperty(value = "规格型号")
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "物资单位")
|
||||||
|
private String unitName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "管理模式")
|
||||||
|
private Integer manageType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编码
|
* 编码
|
||||||
*/
|
*/
|
||||||
|
|
@ -73,5 +81,12 @@ public class RepairTaskDetails extends BaseEntity {
|
||||||
@ApiModelProperty(value = "组织id")
|
@ApiModelProperty(value = "组织id")
|
||||||
private Long companyId;
|
private Long companyId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "退料id")
|
||||||
private Long backId;
|
private Long backId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "维修人员")
|
||||||
|
private String repairer;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "关键字")
|
||||||
|
private String keyword;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import com.bonus.material.repair.domain.RepairRecord;
|
||||||
import com.bonus.material.repair.domain.RepairTaskDetails;
|
import com.bonus.material.repair.domain.RepairTaskDetails;
|
||||||
import com.bonus.material.repair.domain.vo.RepairAuditDetailsVO;
|
import com.bonus.material.repair.domain.vo.RepairAuditDetailsVO;
|
||||||
import com.bonus.material.repair.domain.vo.ScrapApplyDetailsVO;
|
import com.bonus.material.repair.domain.vo.ScrapApplyDetailsVO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修试审核详细Mapper接口
|
* 修试审核详细Mapper接口
|
||||||
|
|
@ -88,7 +89,7 @@ public interface RepairAuditDetailsMapper {
|
||||||
* 根据taskIds批量查询规格名称---批量
|
* 根据taskIds批量查询规格名称---批量
|
||||||
* @param taskIds 任务id集合
|
* @param taskIds 任务id集合
|
||||||
*/
|
*/
|
||||||
Map<Long, String> selectTypeNamesByTaskIds(List<Long> taskIds);
|
Map<Long, String> selectTypeNamesByTaskIds(@Param("taskIds") List<Long> taskIds);
|
||||||
|
|
||||||
List<RepairAuditDetails> selectRepairAuditDetailsByTaskId(Long taskId);
|
List<RepairAuditDetails> selectRepairAuditDetailsByTaskId(Long taskId);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ import com.bonus.material.task.domain.TmTaskAgreement;
|
||||||
import com.bonus.material.task.mapper.TmTaskAgreementMapper;
|
import com.bonus.material.task.mapper.TmTaskAgreementMapper;
|
||||||
import com.bonus.material.task.mapper.TmTaskMapper;
|
import com.bonus.material.task.mapper.TmTaskMapper;
|
||||||
import com.bonus.material.task.domain.TmTask;
|
import com.bonus.material.task.domain.TmTask;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.bonus.material.repair.mapper.RepairAuditDetailsMapper;
|
import com.bonus.material.repair.mapper.RepairAuditDetailsMapper;
|
||||||
import com.bonus.material.repair.service.IRepairAuditDetailsService;
|
import com.bonus.material.repair.service.IRepairAuditDetailsService;
|
||||||
|
|
@ -103,9 +103,9 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
||||||
List<ScrapApplyDetailsVO> repairQuestList = repairAuditDetailsMapper.selectRepairQuestList(repairAuditDetails);
|
List<ScrapApplyDetailsVO> repairQuestList = repairAuditDetailsMapper.selectRepairQuestList(repairAuditDetails);
|
||||||
// 通过流过滤掉空对象 并转换为 List集合
|
// 通过流过滤掉空对象 并转换为 List集合
|
||||||
List<Long> taskIds = repairQuestList.stream()
|
List<Long> taskIds = repairQuestList.stream()
|
||||||
.filter(Objects::nonNull) // 过滤掉空的 ScrapApplyDetailsVO 对象
|
.filter(Objects::nonNull)
|
||||||
.map(ScrapApplyDetailsVO::getTaskId)
|
.map(ScrapApplyDetailsVO::getTaskId)
|
||||||
.filter(Objects::nonNull) // 过滤掉空的 taskId
|
.filter(Objects::nonNull)
|
||||||
.distinct()
|
.distinct()
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
|
@ -113,6 +113,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
||||||
Map<Long, String> typeNameMap = repairAuditDetailsMapper.selectTypeNamesByTaskIds(taskIds);
|
Map<Long, String> typeNameMap = repairAuditDetailsMapper.selectTypeNamesByTaskIds(taskIds);
|
||||||
|
|
||||||
// 设置 itemType
|
// 设置 itemType
|
||||||
|
if (CollectionUtil.isNotEmpty(typeNameMap)) {
|
||||||
for (ScrapApplyDetailsVO scrapApplyDetailsVO : repairQuestList) {
|
for (ScrapApplyDetailsVO scrapApplyDetailsVO : repairQuestList) {
|
||||||
Long taskId = scrapApplyDetailsVO.getTaskId();
|
Long taskId = scrapApplyDetailsVO.getTaskId();
|
||||||
if (taskId != null) {
|
if (taskId != null) {
|
||||||
|
|
@ -122,7 +123,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return repairQuestList;
|
return repairQuestList;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// 异常处理
|
// 异常处理
|
||||||
|
|
|
||||||
|
|
@ -213,6 +213,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
LEFT JOIN tm_task_agreement tta ON tta.task_id = bai.task_id
|
LEFT JOIN tm_task_agreement tta ON tta.task_id = bai.task_id
|
||||||
WHERE
|
WHERE
|
||||||
bcd.parent_id = #{id} and (bcd.is_finished is null or bcd.is_finished != 1)
|
bcd.parent_id = #{id} and (bcd.is_finished is null or bcd.is_finished != 1)
|
||||||
|
<if test="typeId != '' and typeId != null">
|
||||||
|
and bcd.type_id = #{typeId}
|
||||||
|
</if>
|
||||||
GROUP By bcd.type_id,bcd.ma_id
|
GROUP By bcd.type_id,bcd.ma_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="fileUrl" column="file_url" />
|
<result property="fileUrl" column="file_url" />
|
||||||
<result property="companyId" column="company_id" />
|
<result property="companyId" column="company_id" />
|
||||||
<result property="fixCode" column="fix_code" />
|
<result property="fixCode" column="fix_code" />
|
||||||
|
<result property="manageType" column="manage_type" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectPurchaseCheckDetailsVo">
|
<sql id="selectPurchaseCheckDetailsVo">
|
||||||
|
|
@ -43,7 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
select pcd.id, pcd.task_id, pcd.type_id, pcd.purchase_price, pcd.purchase_tax_price, pcd.purchase_num, pcd.check_num, pcd.bind_num, pcd.check_result,
|
select pcd.id, pcd.task_id, pcd.type_id, pcd.purchase_price, pcd.purchase_tax_price, pcd.purchase_num, pcd.check_num, pcd.bind_num, pcd.check_result,
|
||||||
pcd.supplier_id, pcd.status, pcd.create_by, pcd.production_time, pcd.create_time, pcd.update_by, pcd.update_time,
|
pcd.supplier_id, pcd.status, pcd.create_by, pcd.production_time, pcd.create_time, pcd.update_by, pcd.update_time,
|
||||||
pcd.remark, pcd.check_url_name, pcd.check_url, pcd.input_num, pcd.input_status, pcd.input_time, pcd.file_name,
|
pcd.remark, pcd.check_url_name, pcd.check_url, pcd.input_num, pcd.input_status, pcd.input_time, pcd.file_name,
|
||||||
pcd.file_url, pcd.company_id, pcd.fix_code, mt.type_name, mt.unit_name, mtp.type_name as ma_type_name
|
pcd.file_url, pcd.company_id, pcd.fix_code, mt.type_name, mt.unit_name, mtp.type_name as ma_type_name, mt.manage_type as manage_type
|
||||||
from purchase_check_details pcd
|
from purchase_check_details pcd
|
||||||
left join ma_type mt on pcd.type_id = mt.type_id
|
left join ma_type mt on pcd.type_id = mt.type_id
|
||||||
left join ma_type mtp on mt.parent_id = mtp.type_id
|
left join ma_type mtp on mt.parent_id = mtp.type_id
|
||||||
|
|
@ -88,9 +89,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="selectPurchaseCheckDetailsListByTaskId" resultMap="PurchaseCheckDetailsResult">
|
<select id="selectPurchaseCheckDetailsListByTaskId" resultMap="PurchaseCheckDetailsResult">
|
||||||
<include refid="selectPurchaseCheckDetailsJoinVo"/>
|
<include refid="selectPurchaseCheckDetailsJoinVo"/>
|
||||||
where 1=1
|
where 1=1
|
||||||
<if test="status != null">
|
<!-- <if test="status != null">-->
|
||||||
and pcd.status = #{status}
|
<!-- and pcd.status = #{status}-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
<if test="taskId != null">
|
<if test="taskId != null">
|
||||||
and pcd.task_id = #{taskId}
|
and pcd.task_id = #{taskId}
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="repairId" column="repair_id" />
|
<result property="repairId" column="repair_id" />
|
||||||
<result property="maId" column="ma_id" />
|
<result property="maId" column="ma_id" />
|
||||||
<result property="typeId" column="type_id" />
|
<result property="typeId" column="type_id" />
|
||||||
|
<result property="specificationType" column="specification_type" />
|
||||||
|
<result property="machineTypeName" column="machine_type_name" />
|
||||||
<result property="repairNum" column="repair_num" />
|
<result property="repairNum" column="repair_num" />
|
||||||
<result property="repairedNum" column="repaired_num" />
|
<result property="repairedNum" column="repaired_num" />
|
||||||
<result property="scrapNum" column="scrap_num" />
|
<result property="scrapNum" column="scrap_num" />
|
||||||
|
|
@ -31,21 +33,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectRepairAuditDetailsList" parameterType="com.bonus.material.repair.domain.RepairAuditDetails" resultMap="RepairAuditDetailsResult">
|
<select id="selectRepairAuditDetailsList" parameterType="com.bonus.material.repair.domain.RepairAuditDetails" resultMap="RepairAuditDetailsResult">
|
||||||
<include refid="selectRepairAuditDetailsVo"/>
|
select
|
||||||
<where>
|
rad.* ,mt.type_name as specification_type, mt1.type_name as machine_type_name, mma.ma_code as ma_id
|
||||||
<if test="taskId != null "> and task_id = #{taskId}</if>
|
from
|
||||||
<if test="repairId != null "> and repair_id = #{repairId}</if>
|
repair_audit_details rad
|
||||||
<if test="maId != null "> and ma_id = #{maId}</if>
|
left join ma_type mt on rad.type_id = mt.type_id
|
||||||
<if test="typeId != null "> and type_id = #{typeId}</if>
|
left join ma_type mt1 on mt.parent_id = mt1.type_id
|
||||||
<if test="repairNum != null "> and repair_num = #{repairNum}</if>
|
left join ma_machine mma on rad.ma_id= mma.ma_id
|
||||||
<if test="repairedNum != null "> and repaired_num = #{repairedNum}</if>
|
where
|
||||||
<if test="scrapNum != null "> and scrap_num = #{scrapNum}</if>
|
rad.task_id = #{taskId}
|
||||||
<if test="auditBy != null "> and audit_by = #{auditBy}</if>
|
<if test="keyword != null and keyword != ''">
|
||||||
<if test="auditTime != null "> and audit_time = #{auditTime}</if>
|
AND (locate(#{keyword}, mma.ma_code) > 0
|
||||||
<if test="auditRemark != null and auditRemark != ''"> and audit_remark = #{auditRemark}</if>
|
or locate(#{keyword}, mt.type_name) > 0
|
||||||
<if test="status != null and status != ''"> and `status` = #{status}</if>
|
or locate(#{keyword}, mt1.type_name) > 0)
|
||||||
<if test="companyId != null "> and company_id = #{companyId}</if>
|
</if>
|
||||||
</where>
|
<if test="type != null and type != ''">
|
||||||
|
AND mt.type_id = #{type}
|
||||||
|
</if>
|
||||||
|
<if test="typeName != null and typeName != ''">
|
||||||
|
AND mt1.type_id = #{typeName}
|
||||||
|
</if>
|
||||||
|
order by rad.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectRepairAuditDetailsById" parameterType="Long" resultMap="RepairAuditDetailsResult">
|
<select id="selectRepairAuditDetailsById" parameterType="Long" resultMap="RepairAuditDetailsResult">
|
||||||
|
|
|
||||||
|
|
@ -80,16 +80,17 @@
|
||||||
|
|
||||||
<select id="getRepairTaskList" resultType="com.bonus.material.repair.domain.RepairTask">
|
<select id="getRepairTaskList" resultType="com.bonus.material.repair.domain.RepairTask">
|
||||||
SELECT
|
SELECT
|
||||||
rd.task_id,
|
rd.task_id as taskId,
|
||||||
|
rd.repairer,
|
||||||
tt.CODE AS repairCode,
|
tt.CODE AS repairCode,
|
||||||
bui.unit_name AS backUnit,
|
|
||||||
bpi.lot_name AS backPro,
|
|
||||||
su.nick_name AS createName,
|
|
||||||
tt.create_time AS createTime,
|
tt.create_time AS createTime,
|
||||||
bai.CODE AS backCode,
|
|
||||||
sd.name AS repairStatus,
|
|
||||||
tt.task_status AS repairStatusCode,
|
tt.task_status AS repairStatusCode,
|
||||||
tt.company_id AS companyId,
|
tt.company_id AS companyId,
|
||||||
|
tt.remark,
|
||||||
|
bui.unit_name AS backUnit,
|
||||||
|
bpi.pro_name AS backPro,
|
||||||
|
su.nick_name AS createName,
|
||||||
|
bai.CODE AS backCode,
|
||||||
GROUP_CONCAT(DISTINCT mt2.type_name) as type
|
GROUP_CONCAT(DISTINCT mt2.type_name) as type
|
||||||
FROM
|
FROM
|
||||||
repair_apply_details rd
|
repair_apply_details rd
|
||||||
|
|
@ -97,13 +98,12 @@
|
||||||
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 bai.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_info bui ON bai2.unit_id = bui.unit_id
|
LEFT JOIN bm_unit bui ON bai2.unit_id = bui.unit_id
|
||||||
LEFT JOIN bm_project_lot bpi ON bai2.project_id = bpi.lot_id and bpi.status = '0' and bpi.del_flag = '0'
|
LEFT JOIN bm_project bpi ON bai2.project_id = bpi.pro_id and bpi.del_flag = '0'
|
||||||
left join sys_user su on rd.create_by = su.user_id
|
left join sys_user su on rd.create_by = su.user_id
|
||||||
left join sys_dic sd on sd.id = tt.task_status
|
<where>
|
||||||
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}, su.nick_name) > 0
|
||||||
or locate(#{keyword}, tt.CODE) > 0)
|
or locate(#{keyword}, tt.CODE) > 0)
|
||||||
|
|
@ -112,7 +112,7 @@
|
||||||
AND bui.unit_id = #{backUnit}
|
AND bui.unit_id = #{backUnit}
|
||||||
</if>
|
</if>
|
||||||
<if test="backPro != null and backPro != ''">
|
<if test="backPro != null and backPro != ''">
|
||||||
AND bpi.lot_id = #{backPro}
|
AND bpi.pro_id = #{backPro}
|
||||||
</if>
|
</if>
|
||||||
<if test="type != null and type != ''">
|
<if test="type != null and type != ''">
|
||||||
AND mt2.type_id = #{type}
|
AND mt2.type_id = #{type}
|
||||||
|
|
@ -126,7 +126,8 @@
|
||||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
<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')
|
AND tt.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
|
||||||
</if>
|
</if>
|
||||||
GROUP BY rd.task_id,bui.unit_name,bpi.lot_name,bai.code,su.nick_name
|
</where>
|
||||||
|
GROUP BY rd.task_id,bui.unit_name,bpi.pro_name,bai.code,su.nick_name
|
||||||
order by tt.create_time desc
|
order by tt.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
@ -139,7 +140,6 @@
|
||||||
su.nick_name AS createName,
|
su.nick_name AS createName,
|
||||||
tt.create_time AS createTime,
|
tt.create_time AS createTime,
|
||||||
bai.CODE AS backCode,
|
bai.CODE AS backCode,
|
||||||
sd.NAME AS repairStatus,
|
|
||||||
tt.task_status AS repairStatusCode,
|
tt.task_status AS repairStatusCode,
|
||||||
tt.company_id AS companyId,
|
tt.company_id AS companyId,
|
||||||
mt2.type_name AS type,
|
mt2.type_name AS type,
|
||||||
|
|
@ -157,13 +157,12 @@
|
||||||
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 bai.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_info bui ON bai2.unit_id = bui.unit_id
|
LEFT JOIN bm_unit_info bui ON bai2.unit_id = bui.unit_id
|
||||||
LEFT JOIN bm_project_lot bpi ON bai2.project_id = bpi.lot_id AND bpi.STATUS = '0' AND bpi.del_flag = '0'
|
LEFT JOIN bm_project_lot bpi ON bai2.project_id = bpi.lot_id AND bpi.STATUS = '0' AND bpi.del_flag = '0'
|
||||||
LEFT JOIN sys_user su ON rd.create_by = su.user_id
|
LEFT JOIN sys_user su ON rd.create_by = su.user_id
|
||||||
left join sys_user su2 on rd.repairer = su2.user_id
|
left join sys_user su2 on rd.repairer = su2.user_id
|
||||||
LEFT JOIN sys_dic sd ON sd.id = tt.task_status
|
|
||||||
LEFT JOIN ma_machine mm ON mm.ma_id = rd.ma_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 != ''">
|
||||||
|
|
@ -205,6 +204,8 @@
|
||||||
rad.ma_id as maId,
|
rad.ma_id as maId,
|
||||||
mt2.type_name as typeName,
|
mt2.type_name as typeName,
|
||||||
mt.type_name as type,
|
mt.type_name as type,
|
||||||
|
mt.unit_name as unitName,
|
||||||
|
mt.manage_type as manageType,
|
||||||
mm.ma_code as code,
|
mm.ma_code as code,
|
||||||
rad.repair_num as repairNum,
|
rad.repair_num as repairNum,
|
||||||
rad.repaired_num as repairedNum,
|
rad.repaired_num as repairedNum,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue