维修功能修改
This commit is contained in:
parent
85207c254d
commit
8109f4b9d2
|
|
@ -18,7 +18,8 @@ public enum TmTaskTypeEnum {
|
|||
TM_TASK_AGREEMENT_MANAGEMENT(10, "新增协议任务"),
|
||||
TM_TASK_REPAIR_INPUT(11, "修饰后入库任务"),
|
||||
TM_TASK_PART_LEASE(12, "配件领料任务"),
|
||||
TM_TASK_PART_TYPE(13, "配件新购");
|
||||
TM_TASK_PART_TYPE(13, "配件新购"),
|
||||
TM_TASK_REPAIR_NUM(14, "数量维修人员信息附件");
|
||||
|
||||
private final Integer taskTypeId;
|
||||
private final String taskTypeName;
|
||||
|
|
|
|||
|
|
@ -122,4 +122,11 @@ public interface BmQrBoxMapper {
|
|||
* @return
|
||||
*/
|
||||
List<BmQrBoxInfo> getBoxBindListById(BmQrBoxInfo bmQrBoxInfo);
|
||||
|
||||
/**
|
||||
* 根据物资ID查询标准箱绑定详情
|
||||
* @param maId
|
||||
* @return
|
||||
*/
|
||||
List<BmQrBoxInfo> selectByMaId(Long maId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import com.bonus.common.core.utils.DateUtils;
|
|||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.basic.domain.BmQrBoxInfo;
|
||||
import com.bonus.material.basic.mapper.BmAgreementInfoMapper;
|
||||
import com.bonus.material.basic.mapper.BmQrBoxMapper;
|
||||
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||
|
|
@ -33,6 +34,7 @@ import com.bonus.material.lease.mapper.LeaseOutDetailsMapper;
|
|||
import com.bonus.common.biz.domain.lease.LeaseOutDetails;
|
||||
import com.bonus.material.lease.service.ILeaseOutDetailsService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
|
@ -192,9 +194,13 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
|
|||
}
|
||||
// 6、如果标准箱入库,需要将设备从标准箱移出
|
||||
if (record.getMaId() != null) {
|
||||
res = updateBoxBind(record);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("出库失败,移出设备失败");
|
||||
// 先查询设备是否在标准箱中
|
||||
List<BmQrBoxInfo> list = bmQrBoxMapper.selectByMaId(record.getMaId());
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
res = updateBoxBind(record);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("出库失败,移出设备失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -51,6 +51,19 @@ public class TypeRepairController extends BaseController
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询维修班机具配置下拉列表
|
||||
* @param typeRepair
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询维修班机具配置下拉")
|
||||
@RequiresPermissions("ma:repair:list")
|
||||
@GetMapping("/getRepairList")
|
||||
public AjaxResult getRepairList(TypeRepair typeRepair)
|
||||
{
|
||||
return typeRepairService.getRepairList(typeRepair);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出维修班机具配置列表
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@ public class TypeRepair extends BaseEntity {
|
|||
@ApiModelProperty(value = "用户姓名")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty(value = "维修人")
|
||||
private String repairer;
|
||||
|
||||
/** 数据所属组织 */
|
||||
@Excel(name = "数据所属组织")
|
||||
@ApiModelProperty(value = "数据所属组织")
|
||||
|
|
|
|||
|
|
@ -97,4 +97,11 @@ public interface PartTypeMapper
|
|||
List<Integer> selectParentId(PartType partType);
|
||||
|
||||
List<PartType> getListByTypeName(@Param("paId") Long id, @Param("type") PartType partType);
|
||||
|
||||
/**
|
||||
* 查询配件库存
|
||||
* @param partType
|
||||
* @return
|
||||
*/
|
||||
List<PartType> select(PartType partType);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.bonus.material.ma.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.ma.domain.TypeRepair;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
|
@ -70,4 +72,11 @@ public interface TypeRepairMapper {
|
|||
* @return
|
||||
*/
|
||||
int deleteTypeRepairByUserIdAndTypeId(@Param("list") List<TypeRepair> typeRepairs);
|
||||
|
||||
/**
|
||||
* 查询维修班机具配置列表并关联查询用户姓名
|
||||
* @param typeRepair
|
||||
* @return
|
||||
*/
|
||||
List<TypeRepair> getRepairList(TypeRepair typeRepair);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.bonus.material.ma.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.ma.domain.TypeRepair;
|
||||
|
||||
/**
|
||||
|
|
@ -67,4 +69,11 @@ public interface ITypeRepairService {
|
|||
* 根据用户id和类型id删除配置信息
|
||||
*/
|
||||
int deleteTypeRepairByUserIdAndTypeId(List<TypeRepair> typeRepairs);
|
||||
|
||||
/**
|
||||
* 查询维修班机具配置下拉列表
|
||||
* @param typeRepair
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getRepairList(TypeRepair typeRepair);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.material.ma.service.impl;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
import com.bonus.common.biz.domain.TreeBuild;
|
||||
import com.bonus.common.biz.domain.TreeNode;
|
||||
|
|
@ -10,7 +11,6 @@ import com.bonus.common.biz.enums.HttpCodeEnum;
|
|||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.ma.domain.vo.MaTypeVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -51,17 +51,55 @@ public class PartTypeServiceImpl implements IPartTypeService
|
|||
* @return 配件类型管理
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult selectPartTypeList(PartType partType)
|
||||
{
|
||||
public AjaxResult selectPartTypeList(PartType partType) {
|
||||
List<TreeNode> groupList = new ArrayList<>();
|
||||
List<TreeNode> list = new ArrayList<>();
|
||||
try {
|
||||
String userId = SecurityUtils.getUserId().toString();
|
||||
partType.setCreateBy(userId);
|
||||
List<PartType> partTypeList = partTypeMapper.select(partType);
|
||||
list = partTypeMapper.selectPartTypeList(partType);
|
||||
List<TreeNode> newList = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
// 创建树形结构(数据集合作为参数)
|
||||
TreeBuild treeBuild = new TreeBuild(list);
|
||||
// 原查询结果转换树形结构
|
||||
groupList = treeBuild.buildTree();
|
||||
if (CollectionUtils.isNotEmpty(partTypeList)) {
|
||||
for (TreeNode treeNode : list) {
|
||||
for (PartType type : partTypeList) {
|
||||
if (treeNode.getId() == (type.getId())) {
|
||||
long parentId = treeNode.getParentId();
|
||||
// 从 list 集合中获取 id 为 parentId 的数据
|
||||
Optional<TreeNode> parentNodeOpt = list.stream()
|
||||
.filter(node -> node.getId() == parentId)
|
||||
.findFirst();
|
||||
if (parentNodeOpt.isPresent()) {
|
||||
TreeNode parentNode = parentNodeOpt.get();
|
||||
long parentNodeParentId = parentNode.getParentId();
|
||||
Optional<TreeNode> newParentNodeOpt = list.stream()
|
||||
.filter(node -> node.getId() == parentNodeParentId)
|
||||
.findFirst();
|
||||
if (newParentNodeOpt.isPresent()) {
|
||||
TreeNode newParentNode = newParentNodeOpt.get();
|
||||
// 检查 parentNode 是否已经存在于 newList 中
|
||||
if (!newList.contains(parentNode)) {
|
||||
newList.add(parentNode);
|
||||
}
|
||||
// 检查 newParentNode 是否已经存在于 newList 中
|
||||
if (!newList.contains(newParentNode)) {
|
||||
newList.add(newParentNode);
|
||||
}
|
||||
}
|
||||
// 检查 treeNode 是否已经存在于 newList 中
|
||||
if (!newList.contains(treeNode)) {
|
||||
newList.add(treeNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 创建树形结构(数据集合作为参数)
|
||||
TreeBuild treeBuild = new TreeBuild(newList);
|
||||
// 原查询结果转换树形结构
|
||||
groupList = treeBuild.buildTree();
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("配件类型树-查询失败", e);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.material.ma.service.impl;
|
|||
|
||||
import java.util.List;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.material.ma.mapper.TypeRepairMapper;
|
||||
|
|
@ -118,4 +119,14 @@ public class TypeRepairServiceImpl implements ITypeRepairService {
|
|||
public int deleteTypeRepairByUserIdAndTypeId(List<TypeRepair> typeRepairs) {
|
||||
return typeRepairMapper.deleteTypeRepairByUserIdAndTypeId(typeRepairs);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询维修班机具配置下拉列表
|
||||
* @param typeRepair
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult getRepairList(TypeRepair typeRepair) {
|
||||
return AjaxResult.success(typeRepairMapper.getRepairList(typeRepair));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,6 +63,19 @@ public class RepairAuditDetailsController extends BaseController {
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询修试审核任务详情
|
||||
* @param repairAuditDetails
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("查询修试审核任务详情")
|
||||
@GetMapping("/getDetailsList")
|
||||
public TableDataInfo getDetailsList(RepairAuditDetails repairAuditDetails) {
|
||||
startPage();
|
||||
List<RepairAuditDetails> list = repairAuditDetailsService.getDetailsList(repairAuditDetails);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出修试审核任务列表
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -60,6 +60,20 @@ public class RepairController extends BaseController {
|
|||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取维修任务列表--分页
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取维修任务详情列表--分页")
|
||||
@GetMapping("/getDetailsList")
|
||||
//@RequiresPermissions(value = "repair:manage:list")
|
||||
public TableDataInfo getDetailsList(RepairPartDetails bean) {
|
||||
startPage();
|
||||
List<RepairPartDetails> list = service.getDetailsList(bean);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取维修任务列表--不分页--NO_PAGE
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -83,6 +83,9 @@ public class RepairAuditDetails extends BaseEntity {
|
|||
@ApiModelProperty(value = "审核人")
|
||||
private Long auditBy;
|
||||
|
||||
@ApiModelProperty(value = "审核人")
|
||||
private String auditName;
|
||||
|
||||
/** 审核时间 */
|
||||
@ApiModelProperty(value = "审核时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
|
|
@ -120,6 +123,9 @@ public class RepairAuditDetails extends BaseEntity {
|
|||
@ApiModelProperty(value = "设备类型")
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(value = "设备编号")
|
||||
private String maCode;
|
||||
|
||||
@ApiModelProperty(value = "管理模式")
|
||||
private String manageType;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,11 +36,20 @@ public class RepairPartDetails extends BaseEntity {
|
|||
@ApiModelProperty(value = "机具ID")
|
||||
private Long maId;
|
||||
|
||||
@ApiModelProperty(value = "机具编码")
|
||||
private String maCode;
|
||||
|
||||
/** 规格ID */
|
||||
@Excel(name = "规格ID")
|
||||
@ApiModelProperty(value = "规格ID")
|
||||
private Long typeId;
|
||||
|
||||
@ApiModelProperty(value = "设备名称")
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
private String typeModelName;
|
||||
|
||||
/** 配件ID */
|
||||
@Excel(name = "配件ID")
|
||||
@ApiModelProperty(value = "配件ID")
|
||||
|
|
@ -51,6 +60,9 @@ public class RepairPartDetails extends BaseEntity {
|
|||
@ApiModelProperty(value = "配件数量")
|
||||
private Integer partNum;
|
||||
|
||||
@ApiModelProperty(value = "配件库存数量")
|
||||
private Integer storageNum;
|
||||
|
||||
/** 配件费用 */
|
||||
@Excel(name = "配件费用")
|
||||
@ApiModelProperty(value = "配件费用")
|
||||
|
|
|
|||
|
|
@ -2,12 +2,14 @@ package com.bonus.material.repair.domain.vo;
|
|||
|
||||
import com.bonus.material.basic.domain.BmFileInfo;
|
||||
import com.bonus.material.repair.domain.RepairPartDetails;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -81,6 +83,11 @@ public class RepairDeviceVO {
|
|||
@ApiModelProperty(value = "维修费用小计计")
|
||||
private BigDecimal totalCost;
|
||||
|
||||
@ApiModelProperty(value = "数量--维修人员信息集合")
|
||||
private List<RepairPartDetails> repairList;
|
||||
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "编码--内部维修配件集合")
|
||||
private List<RepairPartDetails> codeInRepairPartList;
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public interface RepairAuditDetailsMapper {
|
|||
* @param ids 批量修试审核详细
|
||||
* @return 结果
|
||||
*/
|
||||
int updateRepairAuditDetailsBatch(@Param("ids") List<Long> ids, @Param("status") String status);
|
||||
int updateRepairAuditDetailsBatch(@Param("ids") List<Long> ids, @Param("status") String status, @Param("auditBy") Long auditBy);
|
||||
|
||||
/**
|
||||
* 删除修试审核详细
|
||||
|
|
@ -136,4 +136,11 @@ public interface RepairAuditDetailsMapper {
|
|||
* @param details
|
||||
*/
|
||||
void updateMachine(RepairAuditDetails details);
|
||||
|
||||
/**
|
||||
* 查询修试审核任务详情
|
||||
* @param repairAuditDetails
|
||||
* @return
|
||||
*/
|
||||
List<RepairAuditDetails> getDetailsList(RepairAuditDetails repairAuditDetails);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -184,4 +184,32 @@ public interface RepairMapper {
|
|||
List<RepairInputDetailsVo> getRepairedList(RepairInputDetailsVo dto);
|
||||
|
||||
List<RepairInputDetailsVo> getRepairedDetailList(RepairInputDetailsVo dto);
|
||||
|
||||
/**
|
||||
* 维修人信息修改
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
int updateRepairer(RepairDeviceVO bean);
|
||||
|
||||
/**
|
||||
* 扣减个人库配件库存数量
|
||||
* @param partDetails
|
||||
* @return
|
||||
*/
|
||||
int updateStorageNum(RepairPartDetails partDetails);
|
||||
|
||||
/**
|
||||
* 扣减ma_part_type表库存
|
||||
* @param partDetails
|
||||
* @return
|
||||
*/
|
||||
int updateMaTypeStockNum(RepairPartDetails partDetails);
|
||||
|
||||
/**
|
||||
* 查询维修明细
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<RepairPartDetails> getDetailsList(RepairPartDetails bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,4 +112,11 @@ public interface IRepairAuditDetailsService {
|
|||
* @return 结果
|
||||
*/
|
||||
int deleteRepairAuditDetailsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询修试审核任务详情
|
||||
* @param repairAuditDetails
|
||||
* @return
|
||||
*/
|
||||
List<RepairAuditDetails> getDetailsList(RepairAuditDetails repairAuditDetails);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.material.repair.service;
|
|||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.repair.domain.RepairApplyRecord;
|
||||
import com.bonus.material.repair.domain.RepairPartDetails;
|
||||
import com.bonus.material.repair.domain.RepairTask;
|
||||
import com.bonus.material.repair.domain.RepairTaskDetails;
|
||||
import com.bonus.material.repair.domain.vo.RepairDeviceSummaryVo;
|
||||
|
|
@ -86,4 +87,11 @@ public interface RepairService {
|
|||
List<RepairInputDetailsVo> getRepairedList(RepairInputDetailsVo dto);
|
||||
|
||||
List<RepairInputDetailsVo> getRepairedDetailList(RepairInputDetailsVo dto);
|
||||
|
||||
/**
|
||||
* 获取维修明细列表
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<RepairPartDetails> getDetailsList(RepairPartDetails bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -520,7 +520,8 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
.map(RepairAuditDetails::getId)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList());
|
||||
return repairAuditDetailsMapper.updateRepairAuditDetailsBatch(ids, String.valueOf(status));
|
||||
Long auditBy = SecurityUtils.getUserId();
|
||||
return repairAuditDetailsMapper.updateRepairAuditDetailsBatch(ids, String.valueOf(status), auditBy);
|
||||
} catch (final Exception e) {
|
||||
throw new ServiceException("错误信息描述");
|
||||
}
|
||||
|
|
@ -557,7 +558,8 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
}
|
||||
|
||||
try {
|
||||
return repairAuditDetailsMapper.updateRepairAuditDetailsBatch(ids, status);
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
return repairAuditDetailsMapper.updateRepairAuditDetailsBatch(ids, status, userId);
|
||||
} catch (final Exception e) {
|
||||
throw new ServiceException("错误信息描述");
|
||||
}
|
||||
|
|
@ -660,4 +662,14 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
public int deleteRepairAuditDetailsById(Long id) {
|
||||
return repairAuditDetailsMapper.deleteRepairAuditDetailsById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询修试审核任务详情
|
||||
* @param repairAuditDetails
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<RepairAuditDetails> getDetailsList(RepairAuditDetails repairAuditDetails) {
|
||||
return repairAuditDetailsMapper.getDetailsList(repairAuditDetails);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -434,6 +434,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
for (RepairDeviceVO bean : repairDeviceVOList) {
|
||||
if (bean.getManageType() == null) {throw new ServiceException("请选择物资管理方式");}
|
||||
if (Objects.equals(MaTypeManageTypeEnum.CODE_DEVICE.getTypeId(), bean.getManageType())) {
|
||||
partList = bean.getNumberInRepairPartList();
|
||||
// 物资管理方式--编码管理
|
||||
if (bean.getRepairType() == null) {continue;}
|
||||
// 根据维修方式,更新维修数量、报废数量
|
||||
|
|
@ -472,7 +473,23 @@ public class RepairServiceImpl implements RepairService {
|
|||
if (null == bean.getRepairType()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 更新维修人员信息
|
||||
if (!CollectionUtils.isEmpty(bean.getRepairList())) {
|
||||
RepairPartDetails repairPartDetails = bean.getRepairList().get(0);
|
||||
bean.setRepairer(repairPartDetails.getRepairer());
|
||||
bean.setRemark(repairPartDetails.getRemark());
|
||||
repairMapper.updateRepairer(bean);
|
||||
for (RepairPartDetails partDetails : bean.getRepairList()) {
|
||||
if (!CollectionUtils.isEmpty(partDetails.getFileList())) {
|
||||
for (BmFileInfo bmFileInfo : partDetails.getFileList()) {
|
||||
bmFileInfo.setTaskType(TmTaskTypeEnum.TM_TASK_REPAIR_NUM.getTaskTypeId())
|
||||
.setTaskId(bean.getTaskId()).setModelId(bean.getId())
|
||||
.setCreateBy(loginUser.getUsername());
|
||||
bmFileInfoMapper.insertBmFileInfo(bmFileInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
BigDecimal innerRepairNum = BigDecimal.ZERO;
|
||||
BigDecimal outerRepairNum = BigDecimal.ZERO;
|
||||
BigDecimal scrapNum = BigDecimal.ZERO;
|
||||
|
|
@ -686,7 +703,8 @@ public class RepairServiceImpl implements RepairService {
|
|||
repairApplyRecord.setCreateBy(loginUser.getUsername());
|
||||
repairApplyRecord.setStatus(0L);
|
||||
|
||||
if (null != partDetails.getPartId() && null != partDetails.getPartNum()) {
|
||||
if ((partDetails.getId() != null || partDetails.getPartId() != null) && null != partDetails.getPartNum()) {
|
||||
partDetails.setPartId(partDetails.getPartId() != null ? partDetails.getPartId() : partDetails.getId());
|
||||
// 有维修配件时,如果价格为空,设置为0
|
||||
if (null == partDetails.getPartCost()) {partDetails.setPartCost(BigDecimal.ZERO);}
|
||||
|
||||
|
|
@ -709,6 +727,15 @@ public class RepairServiceImpl implements RepairService {
|
|||
.setPartId(Optional.ofNullable(partDetails.getPartId()).orElse(0L));
|
||||
// 添加【维修记录表】
|
||||
repairMapper.addRecord(repairApplyRecord);
|
||||
// 扣减个人库配件库存数量
|
||||
int res = repairMapper.updateStorageNum(partDetails);
|
||||
if (res > 0) {
|
||||
// 扣减ma_part_type表库存
|
||||
res = repairMapper.updateMaTypeStockNum(partDetails);
|
||||
if (res == 0) {
|
||||
throw new ServiceException("配件库存不足");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 不选维修配件时, 只添加【维修记录表】
|
||||
repairMapper.addRecord(repairApplyRecord);
|
||||
|
|
@ -951,4 +978,14 @@ public class RepairServiceImpl implements RepairService {
|
|||
// }
|
||||
return repairedDetailList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取维修明细列表
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<RepairPartDetails> getDetailsList(RepairPartDetails bean) {
|
||||
return repairMapper.getDetailsList(bean);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ public class ScheduledTasks {
|
|||
System.out.println("没有未签字的退料单");
|
||||
}
|
||||
// 记录任务执行时间
|
||||
log.info("退料人未签字任务执行时间:" + LocalDateTime.now().format(FORMATTER));
|
||||
System.out.println("退料人未签字任务执行时间:" + LocalDateTime.now().format(FORMATTER));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -69,6 +69,9 @@ public class WashHouseScheduledTasks {
|
|||
return "0 0 9 */2 * ?";
|
||||
}
|
||||
|
||||
/**
|
||||
* 未入库定时任务
|
||||
*/
|
||||
public void taskWithWashHouse() {
|
||||
log.info("开始执行未入库定时推送任务");
|
||||
boolean hasNullTask = false;
|
||||
|
|
@ -96,6 +99,7 @@ public class WashHouseScheduledTasks {
|
|||
System.out.println("没有待入库的单子");
|
||||
}
|
||||
// 记录任务执行时间
|
||||
log.info("待入库定时任务执行时间:" + LocalDateTime.now().format(FORMATTER));
|
||||
System.out.println("待入库定时任务执行时间:" + LocalDateTime.now().format(FORMATTER));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -287,4 +287,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
(mm.ma_status = 0 or mm.ma_status =5) and
|
||||
qb.box_id = #{boxId}
|
||||
</select>
|
||||
|
||||
<select id="selectByMaId" resultType="com.bonus.material.basic.domain.BmQrBoxInfo">
|
||||
SELECT
|
||||
qb.id as id,qb.box_id as boxId,qb.create_by as createBy,
|
||||
mt1.type_name as typeName,
|
||||
mt.type_name as typeModelName,
|
||||
mm.ma_id as maId,mm.ma_code as maCode,mm.type_id as maTypeId,
|
||||
mm.buy_task as taskId
|
||||
FROM
|
||||
bm_qrcode_box_bind qb
|
||||
LEFT JOIN ma_machine mm ON qb.ma_id = mm.ma_id
|
||||
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id AND mt.del_flag = '0'
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id AND mt1.del_flag = '0'
|
||||
where
|
||||
qb.ma_id = #{maId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -198,4 +198,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="select" resultType="com.bonus.material.ma.domain.PartType">
|
||||
SELECT
|
||||
part_id AS id,
|
||||
part_num AS storageNum
|
||||
FROM
|
||||
pa_person_storage
|
||||
WHERE
|
||||
part_num > 0 and creator = #{createBy}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -77,6 +77,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join sys_user su on mtk.user_id = su.user_id
|
||||
</select>
|
||||
|
||||
<select id="getRepairList" resultType="com.bonus.material.ma.domain.TypeRepair">
|
||||
SELECT DISTINCT
|
||||
mtk.user_id as userId,
|
||||
su.nick_name as repairer
|
||||
FROM
|
||||
ma_type_repair mtk
|
||||
LEFT JOIN sys_user su ON mtk.user_id = su.user_id
|
||||
<where>
|
||||
<if test="repairer != null and repairer != ''">
|
||||
AND su.nick_name = #{repairer}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
mtk.user_id,
|
||||
su.nick_name
|
||||
</select>
|
||||
|
||||
<delete id="deleteTypeRepairByUserIdAndTypeId">
|
||||
delete from ma_type_repair where
|
||||
type_id in
|
||||
|
|
|
|||
|
|
@ -502,6 +502,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<update id="updateRepairAuditDetailsBatch">
|
||||
update repair_audit_details
|
||||
set status = #{status}, update_time = now()
|
||||
,audit_time = now(), audit_by = #{auditBy}
|
||||
where id in
|
||||
<foreach item="id" index="index" collection="ids" open="(" separator="," close=")">
|
||||
#{id}
|
||||
|
|
@ -540,4 +541,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getDetailsList" resultType="com.bonus.material.repair.domain.RepairAuditDetails">
|
||||
SELECT
|
||||
mt1.type_name as typeName,
|
||||
mt.type_name as specificationType,
|
||||
rad.type_id as typeId,
|
||||
rad.task_id as taskId,
|
||||
mm.ma_code as maCode,
|
||||
su.nick_name as auditName,
|
||||
rad.audit_time as auditTime,
|
||||
rad.repair_num as repairNum,
|
||||
rad.repaired_num as repairedNum,
|
||||
rad.scrap_num as scrapNum
|
||||
FROM
|
||||
repair_audit_details rad
|
||||
LEFT JOIN ma_type mt ON rad.type_id = mt.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 sys_user su on rad.audit_by = su.user_id
|
||||
LEFT JOIN ma_machine mm on mm.ma_id = rad.ma_id
|
||||
WHERE rad.task_id = #{taskId}
|
||||
and rad.type_id = #{typeId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -522,6 +522,31 @@
|
|||
task_id = #{taskId}
|
||||
</select>
|
||||
|
||||
<select id="getDetailsList" resultType="com.bonus.material.repair.domain.RepairPartDetails">
|
||||
SELECT
|
||||
mt1.type_name as typeName,
|
||||
mt.type_name as typeModelName,
|
||||
rar.type_id as typeId,
|
||||
rar.task_id as taskId,
|
||||
mm.ma_code as maCode,
|
||||
rar.repair_num as repairNum,
|
||||
rar.scrap_num as scrapNum,
|
||||
rar.create_by as createBy,
|
||||
rar.create_time as createTime,
|
||||
a.repairer as repairer
|
||||
FROM
|
||||
repair_apply_record rar
|
||||
LEFT JOIN ma_type mt ON rar.type_id = mt.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_machine mm ON rar.ma_id = mm.ma_id
|
||||
LEFT JOIN ( SELECT GROUP_CONCAT( DISTINCT repairer ) AS repairer, task_id, type_id FROM repair_apply_details GROUP BY type_id, task_id ) a ON a.task_id = rar.task_id
|
||||
AND a.type_id = rar.type_id
|
||||
WHERE
|
||||
rar.task_id = #{taskId} and rar.type_id = #{typeId}
|
||||
</select>
|
||||
|
||||
<update id="updateRepairedAndScrapNum">
|
||||
update
|
||||
repair_apply_details
|
||||
|
|
@ -532,4 +557,34 @@
|
|||
where
|
||||
id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateRepairer">
|
||||
update
|
||||
repair_apply_details
|
||||
set
|
||||
repairer = #{repairer},
|
||||
remark = #{remark},
|
||||
update_time = now()
|
||||
where
|
||||
id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateStorageNum">
|
||||
update
|
||||
pa_person_storage
|
||||
set
|
||||
part_num = part_num - #{partNum}
|
||||
where
|
||||
part_id = #{partId}
|
||||
and creator = #{createBy}
|
||||
</update>
|
||||
<update id="updateMaTypeStockNum">
|
||||
update
|
||||
ma_part_type
|
||||
set
|
||||
storage_num = storage_num - #{partNum},
|
||||
update_time = now()
|
||||
where
|
||||
pa_id = #{partId}
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue