Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
aea731d3b8
|
|
@ -22,4 +22,6 @@ public class SysUserRoleVo extends SysUserRole {
|
|||
private String roleName;
|
||||
|
||||
private Long deptId;
|
||||
|
||||
private String ancestors;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,4 +35,6 @@ public class RepairDetails {
|
|||
@Excel(name = "维修时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date repairTime;
|
||||
|
||||
private String nickName;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,4 +93,6 @@ public class RepairInfo {
|
|||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
|
||||
private String nickName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,4 +117,11 @@ public interface BmReportMapper {
|
|||
* @return
|
||||
*/
|
||||
List<ScrapDetailsInfo> getScrapDetailsList(ScrapInfo bean);
|
||||
|
||||
/**
|
||||
* 查询维修人名称
|
||||
* @param repairPersonName
|
||||
* @return
|
||||
*/
|
||||
String selectUserNameById(String repairPersonName);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import com.bonus.material.basic.domain.report.*;
|
|||
import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
||||
import com.bonus.material.basic.mapper.BmReportMapper;
|
||||
import com.bonus.material.basic.service.BmReportService;
|
||||
import org.hibernate.validator.internal.util.StringHelper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
|
@ -227,6 +228,9 @@ public class BmReportServiceImpl implements BmReportService {
|
|||
List<RepairInfo> list = bmReportMapper.getRepairList(bean);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
for (RepairInfo repairInfo : list) {
|
||||
if (!StringHelper.isNullOrEmptyString(repairInfo.getNickName())){
|
||||
repairInfo.setRepairPersonName(repairInfo.getNickName());
|
||||
}
|
||||
totalBackNum = totalBackNum.add(repairInfo.getBackNum());
|
||||
totalRepairedNum = totalRepairedNum.add(repairInfo.getRepairedNum());
|
||||
totalPendingScrapNum = totalPendingScrapNum.add(repairInfo.getPendingScrapNum());
|
||||
|
|
@ -252,7 +256,16 @@ public class BmReportServiceImpl implements BmReportService {
|
|||
*/
|
||||
@Override
|
||||
public List<RepairDetails> getRepairDetailsList(RepairInfo bean) {
|
||||
return bmReportMapper.getRepairDetailsList(bean);
|
||||
List<RepairDetails> list = bmReportMapper.getRepairDetailsList(bean);
|
||||
if (list.size()>0){
|
||||
//处理数据库中维修人字段既有Id也有人员的问题
|
||||
for (RepairDetails repairDetails : list){
|
||||
if (!StringHelper.isNullOrEmptyString(repairDetails.getNickName())){
|
||||
repairDetails.setRepairPersonName(repairDetails.getNickName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -372,4 +385,19 @@ public class BmReportServiceImpl implements BmReportService {
|
|||
public List<ScrapDetailsInfo> getScrapDetailsList(ScrapInfo bean) {
|
||||
return bmReportMapper.getScrapDetailsList(bean);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断字符串是否为纯数字(可用于判断是否为用户ID)
|
||||
*/
|
||||
private boolean isNumeric(String str) {
|
||||
if (str == null || str.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
for (char c : str.toCharArray()) {
|
||||
if (!Character.isDigit(c)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,10 +51,31 @@ public class ApplyEventListener {
|
|||
if (sysWorkflowTypeList.isEmpty()) {
|
||||
throw new ServiceException("新增任务审批记录失败,请创建审核流程");
|
||||
}
|
||||
SysWorkflowRecord sysWorkflowRecord = new SysWorkflowRecord();
|
||||
if (sysWorkflowTypeList.size() == 1) {
|
||||
// 如果该任务类型配置了一个审批流,则直接使用
|
||||
sysWorkflowType = sysWorkflowTypeList.get(0);
|
||||
sysWorkflowRecord = new SysWorkflowRecord();
|
||||
sysWorkflowRecord.setWorkflowId(sysWorkflowType.getId());
|
||||
sysWorkflowRecord.setTaskId(event.getTaskId());
|
||||
sysWorkflowRecord.setTaskType(event.getTaskType());
|
||||
sysWorkflowRecord.setTaskCode(event.getTaskCode());
|
||||
//创建审批任务
|
||||
int count = sysWorkflowRecordMapper.addSysWorkflowRecord(sysWorkflowRecord);
|
||||
if (0 == count) {
|
||||
throw new RuntimeException("创建审批任务失败!");
|
||||
}
|
||||
|
||||
} else {
|
||||
sysWorkflowRecord = new SysWorkflowRecord();
|
||||
sysWorkflowRecord.setTaskId(event.getTaskId());
|
||||
sysWorkflowRecord.setTaskType(event.getTaskType());
|
||||
sysWorkflowRecord.setTaskCode(event.getTaskCode());
|
||||
//创建审批任务
|
||||
int count = sysWorkflowRecordMapper.addSysWorkflowRecord(sysWorkflowRecord);
|
||||
if (0 == count) {
|
||||
throw new RuntimeException("创建审批任务失败!");
|
||||
}
|
||||
// 如果该任务类型配置了多个审批流,则根据任务信息判断使用
|
||||
if (event.getTaskType() == TmTaskTypeEnum.TM_TASK_DIRECT.getTaskTypeId()) {
|
||||
// 直转审批任务,则根据转出和转入的部门判断,同一部门使用无需接收审批流,不同部门则使用需要接收审批流
|
||||
|
|
@ -71,7 +92,12 @@ public class ApplyEventListener {
|
|||
// 如果有转出转入信息,则根据转出转入部门判断使用
|
||||
DirectApplyInfo directApplyInfo = directAuditMapperList.get(0);
|
||||
// 如果转入转出的部门ID相同,则使用不需要接收审批流
|
||||
if (directApplyInfo.getBackUnitId().equals(directApplyInfo.getLeaseUnitId())) {
|
||||
|
||||
//查询是否是同一实施单位
|
||||
int proIdBack = directAuditMapper.getImpUnit(directApplyInfo.getBackProId());
|
||||
int proIdLease = directAuditMapper.getImpUnit(directApplyInfo.getLeaseProId());
|
||||
|
||||
if (proIdBack == proIdLease) {
|
||||
sysWorkflowTypeList.removeIf(removeIfSysWorkflowType -> removeIfSysWorkflowType.getTypeName().contains("需要接收审批"));
|
||||
} else {
|
||||
// 如果转入转出的部门ID不同,则使用需要接收审批流
|
||||
|
|
@ -83,18 +109,12 @@ public class ApplyEventListener {
|
|||
// 除了直转任务外,其他任务类型如果有配置多个审批流,先默认选第一个
|
||||
sysWorkflowType = sysWorkflowTypeList.get(0);
|
||||
}
|
||||
sysWorkflowRecord.setWorkflowId(sysWorkflowType.getId());
|
||||
//插入任务审批类型
|
||||
int countTwo = sysWorkflowRecordMapper.updateSysWorkflowType(sysWorkflowRecord);
|
||||
|
||||
}
|
||||
|
||||
SysWorkflowRecord sysWorkflowRecord = new SysWorkflowRecord();
|
||||
sysWorkflowRecord.setWorkflowId(sysWorkflowType.getId());
|
||||
sysWorkflowRecord.setTaskId(event.getTaskId());
|
||||
sysWorkflowRecord.setTaskType(event.getTaskType());
|
||||
sysWorkflowRecord.setTaskCode(event.getTaskCode());
|
||||
//创建审批任务
|
||||
int count = sysWorkflowRecordMapper.addSysWorkflowRecord(sysWorkflowRecord);
|
||||
if (0 == count) {
|
||||
throw new RuntimeException("创建审批任务失败!");
|
||||
}
|
||||
// 获取新创建的ID
|
||||
int newId = sysWorkflowRecord.getId();
|
||||
//获取当前审核流下的节点
|
||||
|
|
|
|||
|
|
@ -263,6 +263,7 @@ public class TypeController extends BaseController {
|
|||
public AjaxResult add(@RequestBody Type type) {
|
||||
return toAjax(typeService.insertType(type));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改物资库存")
|
||||
@PreventRepeatSubmit
|
||||
// @RequiresPermissions("ma:type:updateNum")
|
||||
|
|
|
|||
|
|
@ -372,9 +372,10 @@ public class MachineServiceImpl implements IMachineService
|
|||
baseInfo.setLeaseTime(null);
|
||||
baseInfo.setLeaseUnit(null);
|
||||
baseInfo.setLeaseProject(null);
|
||||
|
||||
}else{
|
||||
LeaseApplyInfo leaseDetail = machineMapper.getLeaseUnitAndProject(leaseInfo);
|
||||
baseInfo.setLeaseTime(String.valueOf(leaseDetail.getLeaseTime()));
|
||||
baseInfo.setLeaseTime(String.valueOf(leaseInfo.getLeaseTime()));
|
||||
baseInfo.setLeaseUnit(leaseDetail.getUnitName());
|
||||
baseInfo.setLeaseProject(leaseDetail.getProjectName());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,12 @@ import com.bonus.common.core.utils.poi.ExcelUtil;
|
|||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.material.back.domain.vo.BackApplyVo;
|
||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||
import com.bonus.material.ma.domain.LabelBind;
|
||||
import com.bonus.material.repair.domain.*;
|
||||
import com.bonus.material.repair.domain.vo.*;
|
||||
import com.bonus.material.repair.service.RepairService;
|
||||
|
|
@ -19,15 +24,14 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.aspectj.weaver.loadtime.Aj;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author syruan
|
||||
|
|
@ -60,6 +64,7 @@ public class RepairController extends BaseController {
|
|||
|
||||
/**
|
||||
* 获取维修任务列表--分页
|
||||
*
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -74,6 +79,7 @@ public class RepairController extends BaseController {
|
|||
|
||||
/**
|
||||
* 获取维修任务列表--app
|
||||
*
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -159,7 +165,8 @@ public class RepairController extends BaseController {
|
|||
try {
|
||||
String partStrList = bean.getPartStrList();
|
||||
if (StringUtils.isNoneBlank(partStrList)) {
|
||||
List<RepairPartDetails> repairPartDetails = objectMapper.readValue(partStrList, new TypeReference<List<RepairPartDetails>>() {});
|
||||
List<RepairPartDetails> repairPartDetails = objectMapper.readValue(partStrList, new TypeReference<List<RepairPartDetails>>() {
|
||||
});
|
||||
bean.setPartList(Optional.ofNullable(repairPartDetails).orElse(new ArrayList<>()));
|
||||
}
|
||||
return service.submitRepairApply(bean);
|
||||
|
|
@ -210,7 +217,7 @@ public class RepairController extends BaseController {
|
|||
@ApiOperation(value = "驳回退料--批量")
|
||||
//@RequiresPermissions(value = "repair:manage:reject")
|
||||
@PostMapping("/rejectRepair")
|
||||
public AjaxResult rejectRepair(@RequestBody RepairTask bean) {
|
||||
public AjaxResult rejectRepair(@RequestBody RepairTask bean) {
|
||||
return service.rejectRepair(bean);
|
||||
}
|
||||
|
||||
|
|
@ -223,14 +230,14 @@ public class RepairController extends BaseController {
|
|||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 导出维修任务列表--外层--壹级列表
|
||||
*/
|
||||
@PostMapping("/export")
|
||||
//@RequiresPermissions("repair:manage:export")
|
||||
@ApiOperation(value = "导出维修任务列表")
|
||||
public void export(HttpServletResponse response, RepairTask bean) {
|
||||
List<RepairTask> list=new ArrayList<>();
|
||||
List<RepairTask> list = new ArrayList<>();
|
||||
try {
|
||||
list = service.exportRepairTaskList(bean);
|
||||
} catch (Exception e) {
|
||||
|
|
@ -243,7 +250,7 @@ public class RepairController extends BaseController {
|
|||
@ApiOperation(value = "获取修试后入库列表")
|
||||
@GetMapping("getRepairedList")
|
||||
//@RequiresPermissions("warehousing:repair:list")
|
||||
public TableDataInfo getRepairedList(RepairInputDetailsVo dto){
|
||||
public TableDataInfo getRepairedList(RepairInputDetailsVo dto) {
|
||||
startPage();
|
||||
List<RepairInputDetailsVo> list = service.getRepairedList(dto);
|
||||
return getDataTable(list);
|
||||
|
|
@ -252,7 +259,7 @@ public class RepairController extends BaseController {
|
|||
@ApiOperation(value = "获取修试后入库列表-详情")
|
||||
@GetMapping("getRepairedDetailList")
|
||||
//@RequiresPermissions("warehousing:repair:list")
|
||||
public TableDataInfo getRepairedDetailList(RepairInputDetailsVo dto){
|
||||
public TableDataInfo getRepairedDetailList(RepairInputDetailsVo dto) {
|
||||
startPage();
|
||||
List<RepairInputDetailsVo> list = service.getRepairedDetailList(dto);
|
||||
return getDataTable(list);
|
||||
|
|
@ -277,6 +284,7 @@ public class RepairController extends BaseController {
|
|||
|
||||
/**
|
||||
* 查询修试查询-维修配件查询列表
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -291,6 +299,7 @@ public class RepairController extends BaseController {
|
|||
|
||||
/**
|
||||
* 导出修试查询-维修配件查询列表
|
||||
*
|
||||
* @param response
|
||||
* @param dto
|
||||
*/
|
||||
|
|
@ -303,6 +312,7 @@ public class RepairController extends BaseController {
|
|||
|
||||
/**
|
||||
* 查询修试查询-维修配件查询二级列表
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -325,4 +335,70 @@ public class RepairController extends BaseController {
|
|||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "维修检验试验报表")
|
||||
@GetMapping("/getRepairInspection")
|
||||
public TableDataInfo getRepairInspection(RepairInspection dto) {
|
||||
try {
|
||||
startPage();
|
||||
List<RepairInspection> list = service.getRepairInspection(dto);
|
||||
return getDataTable(list);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage());
|
||||
return getDataTable(Collections.emptyList());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出机具设备标签列表
|
||||
*/
|
||||
@ApiOperation(value = "导出维修检验试验报表")
|
||||
@PreventRepeatSubmit
|
||||
@SysLog(title = "机具设备标签", businessType = OperaType.EXPORT, logType = 1, module = "仓储管理->导出维修检验试验报表")
|
||||
@PostMapping("/getRepairInspectionExport")
|
||||
public void getRepairInspectionExport(HttpServletResponse response, RepairInspection dto) {
|
||||
List<RepairInspection> list = service.getRepairInspection(dto);
|
||||
ExcelUtil<RepairInspection> util = new ExcelUtil<RepairInspection>(RepairInspection.class);
|
||||
util.exportExcel(response, list, "机具设备标签数据");
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "维修检验试验报表")
|
||||
@GetMapping("/getTestRecord")
|
||||
public TableDataInfo getTestRecord(TestRecord dto) {
|
||||
try {
|
||||
startPage();
|
||||
List<TestRecord> list = service.getTestRecord(dto);
|
||||
return getDataTable(list);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage());
|
||||
return getDataTable(Collections.emptyList());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出机具设备标签列表
|
||||
*/
|
||||
@ApiOperation(value = "导出维修检验试验报表")
|
||||
@PreventRepeatSubmit
|
||||
@SysLog(title = "机具设备标签", businessType = OperaType.EXPORT, logType = 1, module = "仓储管理->导出维修检验试验报表")
|
||||
@PostMapping("/getTestRecordExport")
|
||||
public void getTestRecordExport(HttpServletResponse response, TestRecord dto) {
|
||||
List<TestRecord> list = service.getTestRecord(dto);
|
||||
ExcelUtil<TestRecord> util = new ExcelUtil<TestRecord>(TestRecord.class);
|
||||
util.exportExcel(response, list, "机具设备标签数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询试验记录表数据
|
||||
*/
|
||||
@ApiOperation(value = "查询试验记录表数据")
|
||||
@GetMapping("/getTestRecordDetails")
|
||||
public AjaxResult getTestRecordDetails(TestRecord bean) {
|
||||
List<RepairTaskDetails> list = service.getTestRecordDetails(bean);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,66 +22,109 @@ public class RepairInputDetailsVo {
|
|||
@ApiModelProperty(value = "规格ID")
|
||||
private Long typeId;
|
||||
|
||||
/** 设备类型*/
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
@Excel(name = "工机具类型")
|
||||
private String typeName2;
|
||||
|
||||
/** 规格型号*/
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
@Excel(name = "规格型号")
|
||||
private String typeName;
|
||||
|
||||
/** 维修单号*/
|
||||
/**
|
||||
* 维修单号
|
||||
*/
|
||||
private String repairCode;
|
||||
|
||||
/** 工器具类型*/
|
||||
/**
|
||||
* 工器具类型
|
||||
*/
|
||||
private String maTypeName;
|
||||
|
||||
/** 维修人员*/
|
||||
/**
|
||||
* 维修人员
|
||||
*/
|
||||
private String wxName;
|
||||
|
||||
/** 维修时间*/
|
||||
/**
|
||||
* 维修时间
|
||||
*/
|
||||
private String wxTime;
|
||||
|
||||
/** 状态*/
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String taskStatus;
|
||||
|
||||
/** 工程 */
|
||||
/**
|
||||
* 工程
|
||||
*/
|
||||
private String projectName;
|
||||
|
||||
/** 单位 */
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unitName;
|
||||
|
||||
/** 关键字*/
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
private String keyWord;
|
||||
|
||||
/** 设备类型*/
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
private String deviceTypeId;
|
||||
|
||||
/** 管理方式(0编号 1计数)*/
|
||||
/**
|
||||
* 管理方式(0编号 1计数)
|
||||
*/
|
||||
private String manageType;
|
||||
|
||||
/** 数量*/
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@Excel(name = "数量")
|
||||
private Integer repairNum;
|
||||
|
||||
/** 编号*/
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Excel(name = "编号")
|
||||
private String maCode;
|
||||
|
||||
/** 提交入库人员*/
|
||||
/**
|
||||
* 提交入库人员
|
||||
*/
|
||||
@Excel(name = "提交入库人员")
|
||||
private String updateBy;
|
||||
|
||||
/** 提交入库时间*/
|
||||
/**
|
||||
* 提交入库时间
|
||||
*/
|
||||
@Excel(name = "提交入库时间")
|
||||
private String updateTime;
|
||||
|
||||
/** 不通过原因*/
|
||||
/**
|
||||
* 不通过原因
|
||||
*/
|
||||
@Excel(name = "不通过原因")
|
||||
private String remark;
|
||||
|
||||
/** 状态*/
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@Excel(name = "状态")
|
||||
private String status;
|
||||
|
||||
|
||||
private String backUnitName;
|
||||
|
||||
private String typeModelName;
|
||||
|
||||
private Integer num;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,145 @@
|
|||
package com.bonus.material.repair.domain.vo;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class RepairInspection implements Serializable {
|
||||
|
||||
/**
|
||||
* 退回单位名称
|
||||
*/
|
||||
@Excel(name = "退料单位")
|
||||
private String backUnitName;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
@Excel(name = "退料工程")
|
||||
private String projectName;
|
||||
/**
|
||||
* 维修单号
|
||||
*/
|
||||
@Excel(name = "维修单号")
|
||||
private String repairCode;
|
||||
|
||||
/**
|
||||
* 类型名称
|
||||
*/
|
||||
@Excel(name = "机具名称")
|
||||
private String typeName;
|
||||
|
||||
|
||||
/**
|
||||
* 型号名称
|
||||
*/
|
||||
@Excel(name = "规格型号")
|
||||
private String typeModelName;
|
||||
|
||||
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
@Excel(name = "计量单位")
|
||||
private String unitName;
|
||||
|
||||
|
||||
/**
|
||||
* 维修数量
|
||||
*/
|
||||
@Excel(name = "退料数量")
|
||||
private String repairNum;
|
||||
|
||||
|
||||
/**
|
||||
* 计算数量(采样比例 * 维修数量)
|
||||
*/
|
||||
@Excel(name = "抽检数量")
|
||||
private String num;
|
||||
|
||||
|
||||
/**
|
||||
* 计算数量(采样比例 * 维修数量)
|
||||
*/
|
||||
@Excel(name = "试验数量")
|
||||
private String expNum;
|
||||
|
||||
@Excel(name = "抽检人")
|
||||
private String samplePerson;
|
||||
|
||||
@Excel(name = "试验人")
|
||||
private String testPerson;
|
||||
|
||||
|
||||
private String unitId;
|
||||
|
||||
private String proId;
|
||||
|
||||
|
||||
/**
|
||||
* 采样比例
|
||||
*/
|
||||
private String samplingRatio;
|
||||
|
||||
/**
|
||||
* 额定负载
|
||||
*/
|
||||
@Excel(name = "额定载荷")
|
||||
private String ratedLoad;
|
||||
|
||||
/**
|
||||
* 测试负载
|
||||
*/
|
||||
@Excel(name = "试验载荷")
|
||||
private String testLoad;
|
||||
|
||||
/**
|
||||
* 保持时间
|
||||
*/
|
||||
@Excel(name = "持荷时间")
|
||||
private String holdingTime;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String maCode;
|
||||
|
||||
|
||||
/**
|
||||
* 任务ID
|
||||
*/
|
||||
private String taskId;
|
||||
|
||||
/**
|
||||
* 类型ID
|
||||
*/
|
||||
private String typeId;
|
||||
|
||||
/**
|
||||
* 物料ID
|
||||
*/
|
||||
private String maId;
|
||||
|
||||
/**
|
||||
* 维修时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date repairTime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
private String startTime;
|
||||
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
private String endTime;
|
||||
|
||||
|
||||
private String keyWord;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,141 @@
|
|||
package com.bonus.material.repair.domain.vo;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class TestRecord implements Serializable {
|
||||
|
||||
private String id;
|
||||
/**
|
||||
* 退回单位名称
|
||||
*/
|
||||
@Excel(name = "退料单位")
|
||||
private String backUnitName;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
@Excel(name = "退料工程")
|
||||
private String projectName;
|
||||
/**
|
||||
* 维修单号
|
||||
*/
|
||||
@Excel(name = "维修单号")
|
||||
private String repairCode;
|
||||
|
||||
/**
|
||||
* 类型名称
|
||||
*/
|
||||
@Excel(name = "机具名称")
|
||||
private String typeName;
|
||||
|
||||
|
||||
/**
|
||||
* 型号名称
|
||||
*/
|
||||
@Excel(name = "规格型号")
|
||||
private String typeModelName;
|
||||
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
@Excel(name = "设备编码")
|
||||
private String maCode;
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
private String unitName;
|
||||
|
||||
|
||||
/**
|
||||
* 维修数量
|
||||
*/
|
||||
|
||||
private String repairNum;
|
||||
|
||||
|
||||
/**
|
||||
* 计算数量(采样比例 * 维修数量)
|
||||
*/
|
||||
|
||||
private String num;
|
||||
|
||||
|
||||
/**
|
||||
* 计算数量(采样比例 * 维修数量)
|
||||
*/
|
||||
|
||||
private String expNum;
|
||||
|
||||
|
||||
private String samplePerson;
|
||||
|
||||
private String testPerson;
|
||||
|
||||
|
||||
private String unitId;
|
||||
|
||||
private String proId;
|
||||
|
||||
|
||||
/**
|
||||
* 采样比例
|
||||
*/
|
||||
private String samplingRatio;
|
||||
|
||||
/**
|
||||
* 额定负载
|
||||
*/
|
||||
private String ratedLoad;
|
||||
|
||||
/**
|
||||
* 测试负载
|
||||
*/
|
||||
private String testLoad;
|
||||
|
||||
/**
|
||||
* 保持时间
|
||||
*/
|
||||
|
||||
private String holdingTime;
|
||||
|
||||
|
||||
/**
|
||||
* 任务ID
|
||||
*/
|
||||
private String taskId;
|
||||
|
||||
/**
|
||||
* 类型ID
|
||||
*/
|
||||
private String typeId;
|
||||
|
||||
/**
|
||||
* 物料ID
|
||||
*/
|
||||
private String maId;
|
||||
|
||||
/**
|
||||
* 维修时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date repairTime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
private String startTime;
|
||||
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
private String endTime;
|
||||
|
||||
|
||||
private String keyWord;
|
||||
|
||||
}
|
||||
|
|
@ -2,10 +2,7 @@ package com.bonus.material.repair.mapper;
|
|||
|
||||
import com.bonus.material.ma.domain.PartType;
|
||||
import com.bonus.material.repair.domain.*;
|
||||
import com.bonus.material.repair.domain.vo.RepairDeviceVO;
|
||||
import com.bonus.material.repair.domain.vo.RepairInputDetailsVo;
|
||||
import com.bonus.material.repair.domain.vo.RepairPartInfo;
|
||||
import com.bonus.material.repair.domain.vo.RepairPartVo;
|
||||
import com.bonus.material.repair.domain.vo.*;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
@ -21,6 +18,7 @@ import java.util.List;
|
|||
public interface RepairMapper {
|
||||
/**
|
||||
* 获取维修任务列表
|
||||
*
|
||||
* @param bean 维修任务信息--查询条件
|
||||
*/
|
||||
List<RepairTask> getRepairTaskList(RepairTask bean);
|
||||
|
|
@ -32,6 +30,7 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 获取维修任务列表
|
||||
*
|
||||
* @param taskId 任务id
|
||||
*/
|
||||
RepairTask getRepairTaskInfoByTaskId(Long taskId);
|
||||
|
|
@ -46,78 +45,89 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 新增维修记录
|
||||
*
|
||||
* @param bean 维修记录信息
|
||||
*/
|
||||
int addRecord(RepairApplyRecord bean);
|
||||
|
||||
/**
|
||||
* 根据id查询维修明细
|
||||
*
|
||||
* @param id 主键key
|
||||
*/
|
||||
RepairTaskDetails getById(Long id);
|
||||
|
||||
/**
|
||||
* 修改维修数量
|
||||
* @param id 主键key
|
||||
*
|
||||
* @param id 主键key
|
||||
* @param repairNum 维修数量
|
||||
* @param repairer 维修人员
|
||||
* @param userId 用户id
|
||||
* @param repairer 维修人员
|
||||
* @param userId 用户id
|
||||
*/
|
||||
int updateRepairedNum(@Param("id") Long id, @Param("repairNum") BigDecimal repairNum, @Param("repairer") Long repairer, @Param("userId") Long userId);
|
||||
|
||||
int updateRepairNum(@Param("id") Long id, @Param("repairNum") BigDecimal repairNum, @Param("repairer") Long repairer, @Param("userId") Long userId);
|
||||
|
||||
int updateThisRepairedAndScrapNum(@Param("id") Long id, @Param("thisRepairedNum") BigDecimal repairNum, @Param("thisScrapNum") BigDecimal thisScrapNum,@Param("repairer") Long repairer, @Param("userId") Long userId);
|
||||
int updateThisRepairedAndScrapNum(@Param("id") Long id, @Param("thisRepairedNum") BigDecimal repairNum, @Param("thisScrapNum") BigDecimal thisScrapNum, @Param("repairer") Long repairer, @Param("userId") Long userId);
|
||||
|
||||
int updateRepairedAndScrapNum(@Param("id") Long id, @Param("thisRepairedNum") BigDecimal repairNum, @Param("thisScrapNum") BigDecimal thisScrapNum,@Param("repairer") Long repairer, @Param("userId") Long userId);
|
||||
int updateRepairedAndScrapNum(@Param("id") Long id, @Param("thisRepairedNum") BigDecimal repairNum, @Param("thisScrapNum") BigDecimal thisScrapNum, @Param("repairer") Long repairer, @Param("userId") Long userId);
|
||||
|
||||
int updateRepairedNumAndStatus(@Param("id") Long id, @Param("repairNum") BigDecimal repairNum, @Param("status") int status, @Param("repairer") String repairer, @Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 修改维修数量
|
||||
* @param id 主键 key
|
||||
*
|
||||
* @param id 主键 key
|
||||
* @param repairNum 维修数量
|
||||
* @param userid 用户id
|
||||
* @param userid 用户id
|
||||
*/
|
||||
int updateRepairedNumTwo(@Param("id") Long id, @Param("repairNum") BigDecimal repairNum, @Param("userId") Long userid);
|
||||
|
||||
/**
|
||||
* 修改维修数量和状态
|
||||
* @param id 主键 key
|
||||
*
|
||||
* @param id 主键 key
|
||||
* @param repairNum 维修数量
|
||||
* @param userid 用户id
|
||||
* @param userid 用户id
|
||||
*/
|
||||
int updateRepairedNumTwoAndStatus(@Param("id") Long id, @Param("repairNum") BigDecimal repairNum, @Param("status") int status, @Param("userId") Long userid);
|
||||
|
||||
/**
|
||||
* 修改报废数量
|
||||
* @param id 主键key
|
||||
*
|
||||
* @param id 主键key
|
||||
* @param scrapNum 报废数量
|
||||
* @param userId 用户id
|
||||
* @param userId 用户id
|
||||
*/
|
||||
int updateScrapNum(@Param("id") Long id, @Param("scrapNum") BigDecimal scrapNum, @Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 修改报废数量和状态
|
||||
* @param id 主键key
|
||||
*
|
||||
* @param id 主键key
|
||||
* @param scrapNum 报废数量
|
||||
* @param userId 用户id
|
||||
* @param userId 用户id
|
||||
*/
|
||||
int updateScrapNumAndStatus(@Param("id") Long id, @Param("scrapNum") BigDecimal scrapNum, @Param("status") int status, @Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 新增配件维修记录
|
||||
*
|
||||
* @param partDetails 配件详情
|
||||
*/
|
||||
int addPart(RepairPartDetails partDetails);
|
||||
|
||||
/**
|
||||
* 完成维修--更改维修状态
|
||||
* @param ids 主键集合
|
||||
*
|
||||
* @param ids 主键集合
|
||||
* @param userName
|
||||
*/
|
||||
int batchQualified(@Param("ids") ArrayList<Long> ids, @Param("userName") String userName);
|
||||
|
||||
int updateMaMachine(@Param("ids") ArrayList<Long> ids, @Param("userName") String userName);
|
||||
|
||||
/**
|
||||
* 根据已修数量、已报废数量--更新维修状态
|
||||
*/
|
||||
|
|
@ -130,8 +140,9 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 修改维修任务状态
|
||||
*
|
||||
* @param taskList 任务列表集合
|
||||
* @param userid 用户id
|
||||
* @param userid 用户id
|
||||
*/
|
||||
int updateTaskStatus(@Param("taskList") List<RepairTask> taskList, @Param("userId") Long userid, @Param("taskStatus") Integer taskStatus);
|
||||
|
||||
|
|
@ -139,30 +150,35 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 新增任务
|
||||
*
|
||||
* @param task 任务信息
|
||||
*/
|
||||
int addTask(RepairTask task);
|
||||
|
||||
/**
|
||||
* 查询协议Id
|
||||
*
|
||||
* @param task 任务信息
|
||||
*/
|
||||
Long getAgreementId(RepairTask task);
|
||||
|
||||
/**
|
||||
* 新增 协议与任务关联
|
||||
*
|
||||
* @param task 任务信息
|
||||
*/
|
||||
int createAgreementTask(RepairTask task);
|
||||
|
||||
/**
|
||||
* 查询是否存在未完成维修的
|
||||
*
|
||||
* @param task 任务信息
|
||||
*/
|
||||
int getUnFinish(RepairTask task);
|
||||
|
||||
/**
|
||||
* 新增修饰审核审核数据
|
||||
*
|
||||
* @param details 数据详情
|
||||
*/
|
||||
int addAuditDetails(RepairTaskDetails details);
|
||||
|
|
@ -179,6 +195,7 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 查询配件价格
|
||||
*
|
||||
* @param partId 配件id
|
||||
*/
|
||||
BigDecimal selectPartPrice(Long partId);
|
||||
|
|
@ -190,6 +207,7 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 维修人信息修改
|
||||
*
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -197,6 +215,7 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 扣减个人库配件库存数量
|
||||
*
|
||||
* @param partDetails
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -204,6 +223,7 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 查询维修明细
|
||||
*
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -211,6 +231,7 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 查询维修审核明细
|
||||
*
|
||||
* @param details
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -218,6 +239,7 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 新增维修任务明细
|
||||
*
|
||||
* @param repairTaskDetail
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -225,6 +247,7 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 查询维修任务明细
|
||||
*
|
||||
* @param taskList
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -232,6 +255,7 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 查询维修任务明细
|
||||
*
|
||||
* @param details
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -239,6 +263,7 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 修改维修任务明细
|
||||
*
|
||||
* @param details
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -246,6 +271,7 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 查询修试查询-维修配件查询列表
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -253,6 +279,7 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 查询配件相关信息
|
||||
*
|
||||
* @param repairPartVo
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -260,6 +287,7 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 查询修试查询-维修配件查询二级列表
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -267,6 +295,7 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 获取维修任务列表--app
|
||||
*
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -274,6 +303,7 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 获取配件
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -281,6 +311,7 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 查询报废数和维修数判断是否提交了一次
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -288,6 +319,7 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 查询定损是否把价格已经添加
|
||||
*
|
||||
* @param repairApplyRecord
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -295,6 +327,7 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 获取维修任务机具列表--三级页面详情列表--编码
|
||||
*
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -302,6 +335,7 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 查询试验记录表数据
|
||||
*
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -309,6 +343,7 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 查询配件
|
||||
*
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -316,6 +351,7 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 删除任务
|
||||
*
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -323,6 +359,7 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 查询已修和已报废数量
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -330,6 +367,7 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 删除单条维修任务
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -337,6 +375,7 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 查询配件数量
|
||||
*
|
||||
* @param partId
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -344,6 +383,7 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 获取配件列表
|
||||
*
|
||||
* @param partId
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -351,6 +391,7 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 修改配件数量
|
||||
*
|
||||
* @param currentPart
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -358,15 +399,25 @@ public interface RepairMapper {
|
|||
|
||||
/**
|
||||
* 查询维修任务信息
|
||||
*
|
||||
* @param repairTask
|
||||
* @return
|
||||
*/
|
||||
RepairTask selectInfo(RepairTask repairTask);
|
||||
|
||||
/**
|
||||
* 查询机具列表--三级页面详情列表
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
* 查询机具列表--三级页面详情列表
|
||||
*
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<RepairDeviceVO> getAppRepairMaTypeListByTaskIdAndTypeId(RepairTaskDetails bean);
|
||||
|
||||
List<RepairInspection> getRepairInspection(RepairInspection dto);
|
||||
|
||||
List<TestRecord> getTestRecord(TestRecord dto);
|
||||
|
||||
List<RepairTaskDetails> getTestRecordDetails(TestRecord bean);
|
||||
|
||||
List<PartType> getPartDetails(RepairTaskDetails bean1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,4 +146,10 @@ public interface RepairService {
|
|||
* @return
|
||||
*/
|
||||
List<RepairDeviceVO> getAppRepairMaTypeListByTaskIdAndTypeId(RepairTaskDetails bean);
|
||||
|
||||
List<RepairInspection> getRepairInspection(RepairInspection dto);
|
||||
|
||||
List<TestRecord> getTestRecord(TestRecord dto);
|
||||
|
||||
List<RepairTaskDetails> getTestRecordDetails(TestRecord bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import org.springframework.stereotype.Service;
|
|||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
|
|
@ -99,6 +100,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
|
||||
/**
|
||||
* 维修任务一级列表
|
||||
*
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -152,6 +154,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
|
||||
/**
|
||||
* 关键字搜索
|
||||
*
|
||||
* @param item
|
||||
* @param keyWord
|
||||
* @return
|
||||
|
|
@ -281,6 +284,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
|
||||
/**
|
||||
* 查询维修单
|
||||
*
|
||||
* @param taskId 任务id
|
||||
*/
|
||||
@Override
|
||||
|
|
@ -317,7 +321,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
List<RepairPart> repairPartList = repairAuditDetailsMapper.getPartDetailsByTaskId(new RepairAuditDetails().setTaskId(taskId));
|
||||
repairPartList = mergePartsNum(repairPartList);
|
||||
List<RepairPart> repairPartList2 = repairAuditDetailsMapper.getPartRecordNum(new RepairAuditDetails().setTaskId(taskId));
|
||||
if(!repairPartList2.isEmpty()){
|
||||
if (!repairPartList2.isEmpty()) {
|
||||
repairPartList.addAll(repairPartList2);
|
||||
}
|
||||
RepairTicketVo result = new RepairTicketVo().setRepairTaskInfo(repairTaskInfo)
|
||||
|
|
@ -335,19 +339,19 @@ public class RepairServiceImpl implements RepairService {
|
|||
}
|
||||
|
||||
public static List<RepairPart> mergePartsNum(@NotNull List<RepairPart> devices) {
|
||||
try {
|
||||
Map<String, RepairPart> map = devices.stream().filter(Objects::nonNull).collect(
|
||||
try {
|
||||
Map<String, RepairPart> map = devices.stream().filter(Objects::nonNull).collect(
|
||||
Collectors.toConcurrentMap(device -> device.getTypeId() + ":" + device.getPartCost() + ":" + device.getPartName(),
|
||||
device -> device, (existing, recently) -> {
|
||||
existing.setPartNum(existing.getPartNum() + recently.getPartNum());
|
||||
return existing;
|
||||
}, ConcurrentHashMap::new)
|
||||
);
|
||||
List<RepairPart> list = new ArrayList<>(map.values());
|
||||
list.forEach(item -> item.setPartCost(Optional.ofNullable(item.getPartPrice()).orElse(BigDecimal.ZERO)
|
||||
.multiply(BigDecimal.valueOf(Optional.ofNullable(item.getPartNum()).orElse(0))))
|
||||
);
|
||||
return list;
|
||||
device -> device, (existing, recently) -> {
|
||||
existing.setPartNum(existing.getPartNum() + recently.getPartNum());
|
||||
return existing;
|
||||
}, ConcurrentHashMap::new)
|
||||
);
|
||||
List<RepairPart> list = new ArrayList<>(map.values());
|
||||
list.forEach(item -> item.setPartCost(Optional.ofNullable(item.getPartPrice()).orElse(BigDecimal.ZERO)
|
||||
.multiply(BigDecimal.valueOf(Optional.ofNullable(item.getPartNum()).orElse(0))))
|
||||
);
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException("Error merging parts" + e.getMessage());
|
||||
}
|
||||
|
|
@ -355,6 +359,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
|
||||
/**
|
||||
* 提交维修记录
|
||||
*
|
||||
* @param bean repairApplyRecord
|
||||
*/
|
||||
@Override
|
||||
|
|
@ -492,7 +497,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
if (null == details.getRepairNum()) {
|
||||
details.setRepairNum(BigDecimal.ZERO);
|
||||
}
|
||||
BigDecimal repairNum = details.getRepairedNum().add(bean.getRepairNum()) ;
|
||||
BigDecimal repairNum = details.getRepairedNum().add(bean.getRepairNum());
|
||||
|
||||
if (repairNum.add(details.getScrapNum()).compareTo(details.getRepairNum()) > 0) {
|
||||
throw new ServiceException("维修数量大于维修总量");
|
||||
|
|
@ -545,11 +550,15 @@ public class RepairServiceImpl implements RepairService {
|
|||
repairDeviceVOList.removeIf(Objects::isNull);
|
||||
|
||||
for (RepairDeviceVO bean : repairDeviceVOList) {
|
||||
if (null == bean.getManageType()) {throw new ServiceException("请选择物资管理方式");}
|
||||
if (null == bean.getManageType()) {
|
||||
throw new ServiceException("请选择物资管理方式");
|
||||
}
|
||||
if (Objects.equals(MaTypeManageTypeEnum.CODE_DEVICE.getTypeId(), bean.getManageType())) {
|
||||
partList = bean.getNumberInRepairPartList();
|
||||
// 物资管理方式--编码管理
|
||||
if (null == bean.getRepairType()) {continue;}
|
||||
if (null == bean.getRepairType()) {
|
||||
continue;
|
||||
}
|
||||
// 根据维修方式,更新维修数量、报废数量
|
||||
switch (bean.getRepairType()) {
|
||||
case INNER_REPAIR: {
|
||||
|
|
@ -691,7 +700,9 @@ public class RepairServiceImpl implements RepairService {
|
|||
// 分拆维修单, 准备数据
|
||||
outerRepairNum = partList.get(0).getRepairNum();
|
||||
|
||||
if (null == partList.get(0).getSupplierId()) {throw new ServiceException("请选择返厂厂家");}
|
||||
if (null == partList.get(0).getSupplierId()) {
|
||||
throw new ServiceException("请选择返厂厂家");
|
||||
}
|
||||
|
||||
// 数量管理--外部返厂维修 -- 记录表插入数据
|
||||
RepairApplyRecord repairApplyRecord = new RepairApplyRecord();
|
||||
|
|
@ -797,6 +808,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
|
||||
/**
|
||||
* 拆分维修单,生成任务协议表
|
||||
*
|
||||
* @param newTaskId
|
||||
* @param agreementId
|
||||
* @return
|
||||
|
|
@ -812,6 +824,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
|
||||
/**
|
||||
* 生成任务表
|
||||
*
|
||||
* @param createBy
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -821,7 +834,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
// 生成维修单号
|
||||
String code = genderWxTaskCode(thisMonthMaxOrder);
|
||||
TmTask tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_REPAIR.getTaskTypeId(), RepairTaskStatusEnum.TASK_LOSS_ASSESSMENT_COMPLETE.getStatus(),
|
||||
null,thisMonthMaxOrder + 1, code);
|
||||
null, thisMonthMaxOrder + 1, code);
|
||||
tmTask.setCreateTime(DateUtils.getNowDate());
|
||||
tmTask.setCreateBy(createBy);
|
||||
// 插入任务
|
||||
|
|
@ -839,20 +852,20 @@ public class RepairServiceImpl implements RepairService {
|
|||
* 它首先检查提交的总维修数量是否超过实际维修数量,如果超过,则抛出异常
|
||||
* 如果本次维修完成了全部维修任务,则直接更新实际维修数量和报废数量,否则,更新本次维修和报废的数量
|
||||
*
|
||||
* @param bean 维修设备的视图对象,包含维修相关信息
|
||||
* @param bean 维修设备的视图对象,包含维修相关信息
|
||||
* @param innerRepairNum 内部维修数量
|
||||
* @param outerRepairNum 外部维修数量
|
||||
* @param scrapNum 报废数量
|
||||
* @param loginUser 当前登录用户信息,用于记录操作者
|
||||
* @param scrapNum 报废数量
|
||||
* @param loginUser 当前登录用户信息,用于记录操作者
|
||||
* @throws ServiceException 如果本次维修提交总数过大,则抛出此异常
|
||||
*/
|
||||
private void splitRepairDetailsToMultiple(RepairDeviceVO bean, BigDecimal innerRepairNum, BigDecimal outerRepairNum, BigDecimal scrapNum, LoginUser loginUser) {
|
||||
if (bean.getRepairNum().compareTo(innerRepairNum.add(outerRepairNum).add(scrapNum) ) < 0) {
|
||||
if (bean.getRepairNum().compareTo(innerRepairNum.add(outerRepairNum).add(scrapNum)) < 0) {
|
||||
throw new ServiceException("本次维修提交总数过大");
|
||||
}
|
||||
//本次修完了
|
||||
// TODO 2024-12-11 阮世耀:经过讨论 这里不管一次是否全部修完 都要先修复this 那么此判断是无意义的
|
||||
if ((bean.getRepairNum().subtract(innerRepairNum).subtract(outerRepairNum).subtract(scrapNum).compareTo(BigDecimal.valueOf(0)) ) == 0) {
|
||||
if ((bean.getRepairNum().subtract(innerRepairNum).subtract(outerRepairNum).subtract(scrapNum).compareTo(BigDecimal.valueOf(0))) == 0) {
|
||||
// TODO 2024-12-12 阮世耀:按逻辑来说 在审核之后才会PUT到真实的维修or报废数量,那么这里统一只修改this值
|
||||
// repairMapper.updateRepairedNum(bean.getId(), innerRepairNum.add(outerRepairNum) , loginUser.getUserid(), loginUser.getUserid());
|
||||
// repairMapper.updateScrapNum(bean.getId(), scrapNum, loginUser.getUserid());
|
||||
|
|
@ -869,8 +882,9 @@ public class RepairServiceImpl implements RepairService {
|
|||
|
||||
/**
|
||||
* 配件列表价格合计
|
||||
*
|
||||
* @param partList 配件列表
|
||||
* @param sfCosts 配件价格合计
|
||||
* @param sfCosts 配件价格合计
|
||||
* @return 配件合计后的价格
|
||||
*/
|
||||
private static BigDecimal countPartCosts(List<RepairPartDetails> partList, BigDecimal sfCosts) {
|
||||
|
|
@ -886,9 +900,10 @@ public class RepairServiceImpl implements RepairService {
|
|||
|
||||
/**
|
||||
* 处理配件集合数据
|
||||
* @param bean 维修申请单
|
||||
* @param partList 配件列表
|
||||
* @param loginUser 当前登录用户
|
||||
*
|
||||
* @param bean 维修申请单
|
||||
* @param partList 配件列表
|
||||
* @param loginUser 当前登录用户
|
||||
* @param manageType 管理方式:0编码管理 1数量管理
|
||||
*/
|
||||
private void copeNumberManageInList(RepairDeviceVO bean, List<RepairPartDetails> partList, LoginUser loginUser, Integer manageType) {
|
||||
|
|
@ -921,14 +936,16 @@ public class RepairServiceImpl implements RepairService {
|
|||
}
|
||||
repairApplyRecord.setCreateBy(loginUser.getSysUser().getNickName());
|
||||
repairApplyRecord.setStatus(0L);
|
||||
if(bean.getInRepairList()!=null){
|
||||
if (bean.getInRepairList() != null) {
|
||||
repairApplyRecord.setRemark(StringUtils.isNotBlank(bean.getInRepairList().get(0).getRemark()) ? bean.getInRepairList().get(0).getRemark() : "");
|
||||
}
|
||||
|
||||
if ((null != partDetails.getId() || null != partDetails.getPartId()) && null != partDetails.getPartNum()) {
|
||||
partDetails.setPartId(null != partDetails.getPartId() ? partDetails.getPartId() : partDetails.getId());
|
||||
// 有维修配件时,如果价格为空,设置为0
|
||||
if (null == partDetails.getPartCost()) {partDetails.setPartCost(BigDecimal.ZERO);}
|
||||
if (null == partDetails.getPartCost()) {
|
||||
partDetails.setPartCost(BigDecimal.ZERO);
|
||||
}
|
||||
|
||||
partDetails.setTaskId(bean.getTaskId()).setMaId(bean.getMaId()).setTypeId(bean.getTypeId()).setCompanyId(null);
|
||||
partDetails.setCreateBy(String.valueOf(loginUser.getUserid()));
|
||||
|
|
@ -989,7 +1006,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
repairApplyRecord.setRepairNum(partList.get(0).getPartNum() != null ? BigDecimal.valueOf(partList.get(0).getPartNum()) : BigDecimal.ZERO);
|
||||
//查询定损是否把价格已经添加
|
||||
int count = repairMapper.getCostCount(repairApplyRecord);
|
||||
if (count<=0){
|
||||
if (count <= 0) {
|
||||
repairMapper.addRepairCost(repairApplyRecord, sfCosts, partList.get(0).getPartType().toString());
|
||||
}
|
||||
}
|
||||
|
|
@ -998,9 +1015,9 @@ public class RepairServiceImpl implements RepairService {
|
|||
if (RepairTypeEnum.RETURN_FACTORY.getTypeId().equals(bean.getRepairType())) {
|
||||
// ---------------校验维修数量-----------------
|
||||
// 统计已维修数量 + 本次维修数量
|
||||
BigDecimal repairNum = bean.getRepairedNum().add(bean.getRepairNum()) ;
|
||||
BigDecimal repairNum = bean.getRepairedNum().add(bean.getRepairNum());
|
||||
// 统计报废数量 + 维修合计数量 不能 大与> 总的待维修量
|
||||
if (repairNum.add(bean.getScrapNum()).compareTo(bean.getRepairNum())>0 ) {
|
||||
if (repairNum.add(bean.getScrapNum()).compareTo(bean.getRepairNum()) > 0) {
|
||||
throw new ServiceException("维修数量大于维修总量");
|
||||
}
|
||||
|
||||
|
|
@ -1008,7 +1025,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
repairMapper.updateRepairedNumTwo(bean.getId(), repairNum, loginUser.getUserid());
|
||||
|
||||
// 编码管理--外部返厂维修
|
||||
if(partList!=null && partList.size()>0){
|
||||
if (partList != null && partList.size() > 0) {
|
||||
for (int i = 0; i < partList.size(); i++) {
|
||||
RepairApplyRecord repairApplyRecord = new RepairApplyRecord().setId(bean.getId()).setTaskId(bean.getTaskId()).setMaId(bean.getMaId())
|
||||
.setTypeId(bean.getTypeId()).setRepairType(RepairTypeEnum.RETURN_FACTORY.getTypeId())
|
||||
|
|
@ -1042,7 +1059,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
repairApplyRecord.setRepairNum(partList.get(i).getPartNum() != null ? BigDecimal.valueOf(partList.get(i).getPartNum()) : BigDecimal.ZERO);
|
||||
//查询定损是否把价格已经添加
|
||||
int count = repairMapper.getCostCount(repairApplyRecord);
|
||||
if (count<=0){
|
||||
if (count <= 0) {
|
||||
repairMapper.addRepairCost(repairApplyRecord, sfCosts, partList.get(i).getPartType().toString());
|
||||
}
|
||||
}
|
||||
|
|
@ -1118,9 +1135,9 @@ public class RepairServiceImpl implements RepairService {
|
|||
BigDecimal scrapNum = BigDecimal.ZERO;
|
||||
String taskCode = "";
|
||||
for (RepairTaskDetails repairTaskDetails : detailsList) {
|
||||
repairedNum = repairedNum.add(repairTaskDetails.getRepairedNum());
|
||||
scrapNum = scrapNum.add(repairTaskDetails.getScrapNum());
|
||||
taskCode = repairTaskDetails.getTaskCode();
|
||||
repairedNum = repairedNum.add(repairTaskDetails.getRepairedNum());
|
||||
scrapNum = scrapNum.add(repairTaskDetails.getScrapNum());
|
||||
taskCode = repairTaskDetails.getTaskCode();
|
||||
}
|
||||
if (repairedNum.add(scrapNum).compareTo(BigDecimal.ZERO) == 0) {
|
||||
return AjaxResult.error("维修单号" + taskCode + "还未进行维修,请先维修后再提交审核!");
|
||||
|
|
@ -1195,7 +1212,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
if (CollectionUtils.isEmpty(repairMapper.getAuditDetailsById(details))) {
|
||||
// 如果合格数和报废数都为0,则未进行维修,不插入审核表
|
||||
if (details.getRepairedNum().compareTo(BigDecimal.ZERO) == 0 &&
|
||||
details.getScrapNum().compareTo(BigDecimal.ZERO) == 0) {
|
||||
details.getScrapNum().compareTo(BigDecimal.ZERO) == 0) {
|
||||
continue;
|
||||
}
|
||||
result = repairMapper.addAuditDetails(details);
|
||||
|
|
@ -1237,6 +1254,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
|
||||
/**
|
||||
* 获取前置任务详情
|
||||
*
|
||||
* @param repairTaskDetails
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -1265,15 +1283,16 @@ public class RepairServiceImpl implements RepairService {
|
|||
private static RepairApplyDetails createRepairDetailsCope(RepairTaskDetails details) {
|
||||
RepairApplyDetails repairApplyDetails = new RepairApplyDetails();
|
||||
repairApplyDetails.setId(details.getId());
|
||||
repairApplyDetails.setRepairedNum( (details.getRepairedNum().add(details.getThisRepairedNum()) ));
|
||||
repairApplyDetails.setRepairedNum((details.getRepairedNum().add(details.getThisRepairedNum())));
|
||||
repairApplyDetails.setThisRepairedNum(BigDecimal.valueOf(0));
|
||||
repairApplyDetails.setScrapNum( (details.getScrapNum().add( details.getThisScrapNum())));
|
||||
repairApplyDetails.setScrapNum((details.getScrapNum().add(details.getThisScrapNum())));
|
||||
repairApplyDetails.setThisScrapNum(BigDecimal.valueOf(0));
|
||||
return repairApplyDetails;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成维修审核单号
|
||||
*
|
||||
* @param thisMonthMaxOrder 当前月最大序号
|
||||
*/
|
||||
private String genderWsTaskCode(int thisMonthMaxOrder) {
|
||||
|
|
@ -1286,6 +1305,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
|
||||
/**
|
||||
* 生成维修单号
|
||||
*
|
||||
* @param thisMonthMaxOrder
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -1299,12 +1319,13 @@ public class RepairServiceImpl implements RepairService {
|
|||
|
||||
/**
|
||||
* 驳回维修申请
|
||||
*
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult rejectRepair(RepairTask bean) {
|
||||
public AjaxResult rejectRepair(RepairTask bean) {
|
||||
try {
|
||||
if (!CollectionUtils.isEmpty(bean.getTaskIds())) {
|
||||
for (Long taskId : bean.getTaskIds()) {
|
||||
|
|
@ -1406,6 +1427,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
|
||||
/**
|
||||
* 驳回至退料详情方法抽取
|
||||
*
|
||||
* @param repairApplyDetails
|
||||
*/
|
||||
private void extractedByDetails(RepairApplyDetails repairApplyDetails) {
|
||||
|
|
@ -1450,6 +1472,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
|
||||
/**
|
||||
* 驳回至退料任务单抽取
|
||||
*
|
||||
* @param taskId
|
||||
*/
|
||||
private void extractedTaskId(Long taskId) {
|
||||
|
|
@ -1492,6 +1515,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int batchQualified(ArrayList<Long> ids) {
|
||||
repairMapper.updateMaMachine(ids, SecurityUtils.getLoginUser().getSysUser().getNickName());
|
||||
return repairMapper.batchQualified(ids, SecurityUtils.getLoginUser().getSysUser().getNickName());
|
||||
}
|
||||
|
||||
|
|
@ -1518,6 +1542,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
|
||||
/**
|
||||
* 获取维修明细列表
|
||||
*
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -1573,7 +1598,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
public List<RepairTaskDetails> getRepairCodeList(RepairTaskDetails bean) {
|
||||
try {
|
||||
return repairMapper.getRepairCodeList(bean);
|
||||
} catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
|
@ -1588,7 +1613,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
bean1.setUserName(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
||||
//查询配件列表
|
||||
List<PartType> partList = repairMapper.getPartData(bean1);
|
||||
if(partList.size() > 0){
|
||||
if (partList.size() > 0) {
|
||||
bean1.setPartTypeList(partList);
|
||||
}
|
||||
}
|
||||
|
|
@ -1610,8 +1635,53 @@ public class RepairServiceImpl implements RepairService {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<RepairInspection> getRepairInspection(RepairInspection dto) {
|
||||
return repairMapper.getRepairInspection(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<TestRecord> getTestRecord(TestRecord dto) {
|
||||
return repairMapper.getTestRecord(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<RepairTaskDetails> getTestRecordDetails(TestRecord bean) {
|
||||
try {
|
||||
//查询
|
||||
List<RepairTaskDetails> list = repairMapper.getTestRecordDetails(bean);
|
||||
if (list.size() > 0) {
|
||||
for (RepairTaskDetails bean1 : list) {
|
||||
bean1.setUserName(SecurityUtils.getLoginUser().getSysUser().getNickName());
|
||||
//查询配件列表
|
||||
List<PartType> partList = repairMapper.getPartDetails(bean1);
|
||||
if (partList.size() > 0) {
|
||||
bean1.setPartTypeList(partList);
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
log.error("查询试验记录表", e.getMessage());
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询修试查询-维修配件查询列表
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -1642,6 +1712,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
|
||||
/**
|
||||
* 查询修试查询-维修配件查询二级列表
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -1661,6 +1732,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
|
||||
/**
|
||||
* 判断维修配件查询二级列表是否包含关键字
|
||||
*
|
||||
* @param item
|
||||
* @param keyWord
|
||||
* @return
|
||||
|
|
@ -1672,6 +1744,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
|
||||
/**
|
||||
* 判断维修配件查询列表是否包含关键字
|
||||
*
|
||||
* @param item
|
||||
* @param keyWord
|
||||
* @return
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public class ScheduledCheckWarning {
|
|||
/**
|
||||
* 定时任务执行频率,每周三/五天上午9点执行一次
|
||||
*/
|
||||
private String cronExpression = "0 0 9 ? * WED,SAT";
|
||||
private String cronExpression = "0 0 9 ? * WED,FRI";
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -71,7 +71,7 @@ public class ScheduledCheckWarning {
|
|||
private String getCronFromDatabase() {
|
||||
// 这里假设从数据库中获取 cron 表达式
|
||||
//return "0 */1 * * * ?";
|
||||
return "0 0 9 ? * WED,SAT";
|
||||
return "0 0 9 ? * WED,FRI";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.bonus.material.ma.domain.DirectApplyInfo;
|
|||
import com.bonus.material.ma.domain.Type;
|
||||
import com.bonus.material.work.domain.DirectAudit;
|
||||
import com.bonus.material.work.domain.SysWorkflowRecord;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -27,4 +28,6 @@ public interface DirectAuditMapper {
|
|||
void updateWorkflowRecord(DirectAudit fr);
|
||||
|
||||
void updateDirectAudit(DirectApplyInfo directApplyInfo);
|
||||
|
||||
int getImpUnit(@Param("proId") String backProId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,4 +23,6 @@ public interface SysWorkflowConfigMapper {
|
|||
String selectRolesByNodeId(Integer nodeId);
|
||||
|
||||
SysWorkflowConfig selectConfigValueInfoByNodeId(Integer nodeId);
|
||||
|
||||
int getImpUnit(String backProId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.material.work.mapper;
|
|||
|
||||
import com.bonus.material.work.domain.SysWorkflowRecord;
|
||||
import com.bonus.material.work.domain.SysWorkflowRecordHistory;
|
||||
import com.bonus.material.work.domain.SysWorkflowType;
|
||||
import com.bonus.material.work.domain.dto.SysWorkflowAuditDto;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
|
@ -28,4 +29,6 @@ public interface SysWorkflowRecordMapper {
|
|||
List<SysWorkflowRecordHistory> getAuditUserByTaskId(SysWorkflowRecordHistory sysWorkflowRecordHistory);
|
||||
|
||||
List<SysWorkflowRecordHistory> getAuditUserByRecordId(@Param("recordId") Integer recordId);
|
||||
|
||||
int updateSysWorkflowType(SysWorkflowRecord sysWorkflowRecord);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.material.work.service;
|
||||
|
||||
|
||||
import com.bonus.material.ma.domain.DirectApplyInfo;
|
||||
import com.bonus.material.work.domain.SysWorkflowNode;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -18,6 +19,7 @@ public interface SysWorkflowNodeService {
|
|||
List<SysWorkflowNode> listByTaskId(SysWorkflowNode sysWorkflowNode);
|
||||
|
||||
void copeNodeConfigPersonValuesByNode(SysWorkflowNode forSysWorkflowNode);
|
||||
void copeNodeConfigPersonValuesByNodeTwo(SysWorkflowNode forSysWorkflowNode, DirectApplyInfo directApplyInfo);
|
||||
|
||||
Map<Integer, SysWorkflowNode> listByProId(SysWorkflowNode sysWorkflowNode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ public class DirectAuditImpl implements IDirectAuditService {
|
|||
// 先根据下个节点的ID去查询下个节点信息
|
||||
SysWorkflowNode nextWorkflowInfo = sysWorkflowNodeMapper.selectSysWorkflowNodeById(sysWorkflowRecordHistoryList.get(0).getNextNodeId());
|
||||
// 再根据下个节点信息查询到配置值
|
||||
sysWorkflowNodeService.copeNodeConfigPersonValuesByNode(nextWorkflowInfo);
|
||||
sysWorkflowNodeService.copeNodeConfigPersonValuesByNodeTwo(nextWorkflowInfo,directApplyInfoNew);
|
||||
directApplyInfoNew.setNodeId(sysWorkflowRecordHistoryList.get(0).getNextNodeId());
|
||||
if (nextWorkflowInfo != null && nextWorkflowInfo.getConfigValues() != null) {
|
||||
directApplyInfoNew.setConfigValue(nextWorkflowInfo.getConfigValues());
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.bonus.common.core.utils.DateUtils;
|
|||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.basic.domain.dto.SysUserRoleVo;
|
||||
import com.bonus.material.basic.mapper.BmUserRoleMapper;
|
||||
import com.bonus.material.ma.domain.DirectApplyInfo;
|
||||
import com.bonus.material.work.domain.SysWorkflowConfig;
|
||||
import com.bonus.material.work.domain.SysWorkflowNode;
|
||||
import com.bonus.material.work.domain.SysWorkflowRecordHistory;
|
||||
|
|
@ -16,10 +17,7 @@ import org.springframework.stereotype.Service;
|
|||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
|
|
@ -223,6 +221,85 @@ public class SysWorkflowNodeServiceImpl implements SysWorkflowNodeService {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void copeNodeConfigPersonValuesByNodeTwo(SysWorkflowNode forSysWorkflowNode, DirectApplyInfo directApplyInfo) {
|
||||
if (forSysWorkflowNode == null) {
|
||||
System.err.println("传入的节点信息为空!");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
// 判断配置的类型
|
||||
if (forSysWorkflowNode.getConfigType() == null || forSysWorkflowNode.getConfigType() == 0) {
|
||||
// 如果配置的是角色,那么要根据角色id去查询有哪些用户
|
||||
String roleIds = forSysWorkflowNode.getRoleIds();
|
||||
// 如果参数没有,那么就从数据库中查询
|
||||
if (roleIds == null || roleIds.isEmpty()) {
|
||||
System.out.println("节点配置角色为空!去再执行数据库查询");
|
||||
roleIds = sysWorkflowConfigMapper.selectRolesByNodeId(forSysWorkflowNode.getNodeId());
|
||||
}
|
||||
if (roleIds != null && !roleIds.isEmpty()) {
|
||||
StringBuilder roleConfigValues = new StringBuilder();
|
||||
String[] roleIdArray = roleIds.split(",");
|
||||
for (String forRoleId : roleIdArray) {
|
||||
List<SysUserRoleVo> userList = bmUserRoleMapper.getUserRoleListByDeptId(SecurityUtils.getLoginUser().getSysUser().getDeptId(), Long.valueOf(forRoleId));
|
||||
if(forSysWorkflowNode.getNodeName().contains("接收方")){
|
||||
int proIdLease = sysWorkflowConfigMapper.getImpUnit(directApplyInfo.getLeaseProId());
|
||||
// 使用 Iterator 迭代器遍历,支持安全删除元素
|
||||
Iterator<SysUserRoleVo> iterator = userList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
SysUserRoleVo user = iterator.next();
|
||||
// 条件1:部门ID等于proIdBack → 保留(跳过删除)
|
||||
if (proIdLease == user.getDeptId()) {
|
||||
continue;
|
||||
}
|
||||
// 条件2:祖先ID列表包含proIdBack → 保留(跳过删除)
|
||||
String ancestors = user.getAncestors();
|
||||
if (ancestors != null && Arrays.asList(ancestors.split(",")).contains(String.valueOf(proIdLease))) {
|
||||
continue;
|
||||
}
|
||||
// 若以上条件均不满足 → 剔除该条数据
|
||||
iterator.remove();
|
||||
}
|
||||
}else{
|
||||
int proIdBack = sysWorkflowConfigMapper.getImpUnit(directApplyInfo.getBackProId());
|
||||
// 使用 Iterator 迭代器遍历,支持安全删除元素
|
||||
Iterator<SysUserRoleVo> iterator = userList.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
SysUserRoleVo user = iterator.next();
|
||||
// 条件1:部门ID等于proIdBack → 保留(跳过删除)
|
||||
if (proIdBack == user.getDeptId()) {
|
||||
continue;
|
||||
}
|
||||
// 条件2:祖先ID列表包含proIdBack → 保留(跳过删除)
|
||||
String ancestors = user.getAncestors();
|
||||
if (ancestors != null && Arrays.asList(ancestors.split(",")).contains(String.valueOf(proIdBack))) {
|
||||
continue;
|
||||
}
|
||||
// 若以上条件均不满足 → 剔除该条数据
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
if (!userList.isEmpty()) {
|
||||
// 如果不是第一次拼接,先添加逗号分隔
|
||||
if (roleConfigValues.length() > 0) {
|
||||
roleConfigValues.append(",");
|
||||
}
|
||||
roleConfigValues.append(userList.stream().map(user -> String.valueOf(user.getUserId())).collect(Collectors.joining(",")));
|
||||
}
|
||||
}
|
||||
forSysWorkflowNode.setConfigValues(roleConfigValues.toString());
|
||||
} else {
|
||||
System.err.println("节点配置角色为空!请检查参数");
|
||||
}
|
||||
} else {
|
||||
System.err.println("节点配置类型为:" + forSysWorkflowNode.getConfigType() + ",方法不进行处理!请检查参数");
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
System.err.println("执行审核流配置角色处理方法时发生异常:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Integer, SysWorkflowNode> listByProId(SysWorkflowNode sysWorkflowNode) {
|
||||
Long userId = SecurityUtils.getLoginUser().getUserid();
|
||||
|
|
|
|||
|
|
@ -356,6 +356,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
bu.unit_name as leaseUnitName,
|
||||
bp.pro_name as leaseProjectName,
|
||||
rad.repairer as repairPersonName,
|
||||
u.nick_name as nickName,
|
||||
tt.`code` as code,
|
||||
rad.task_id as taskId,
|
||||
rad.type_id as typeId,
|
||||
|
|
@ -377,6 +378,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
|
||||
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
|
||||
LEFT JOIN ma_type_manage mtm ON mt4.type_id = mtm.type_id
|
||||
left join sys_user u on u.user_id = rad.repairer and u.del_flag = '0'
|
||||
WHERE
|
||||
1 = 1
|
||||
<if test="userId != null ">
|
||||
|
|
@ -404,6 +406,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mt1.type_name AS typeModelName,
|
||||
mm.ma_code AS maCode,
|
||||
rad.repairer AS repairPersonName,
|
||||
su.nick_name as nickName,
|
||||
rar.create_time AS repairTime
|
||||
FROM
|
||||
repair_apply_details rad
|
||||
|
|
@ -414,6 +417,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN ma_machine mm ON rad.ma_id = mm.ma_id
|
||||
LEFT JOIN repair_apply_record rar ON rad.task_id = rar.task_id
|
||||
and rad.type_id = rar.type_id and rar.ma_id = rad.ma_id
|
||||
left join sys_user su on rad.repairer = su.user_id and su.del_flag = '0'
|
||||
WHERE
|
||||
rad.task_id = #{taskId} and rad.type_id = #{typeId}
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
|
|
@ -584,5 +588,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectUserNameById" resultType="java.lang.String">
|
||||
SELECT
|
||||
u.nick_name as repairPersonName
|
||||
FROM
|
||||
sys_user u
|
||||
WHERE
|
||||
u.user_id = #{repairPersonName}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -6,11 +6,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="getUserRoleListByDeptId" resultType="com.bonus.material.basic.domain.dto.SysUserRoleVo">
|
||||
SELECT
|
||||
su.user_id as userId, su.user_name as userName, su.dept_id as deptId, sr.role_name as roleName, sr.role_id as roleId
|
||||
su.user_id as userId, su.user_name as userName, su.dept_id as deptId, sr.role_name as roleName, sr.role_id as roleId,
|
||||
sd.ancestors as ancestors
|
||||
FROM
|
||||
sys_user su
|
||||
LEFT JOIN
|
||||
sys_user_role sur ON su.user_id = sur.user_id
|
||||
LEFT JOIN
|
||||
sys_dept sd ON su.dept_id = sd.dept_id
|
||||
LEFT JOIN
|
||||
sys_role sr ON sur.role_id = sr.role_id
|
||||
WHERE su.dept_id = #{deptId} AND sr.role_id = #{roleId}
|
||||
|
|
|
|||
|
|
@ -961,7 +961,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LIMIT 100
|
||||
</select>
|
||||
<select id="getLeaseParentId" resultType="com.bonus.common.biz.domain.lease.LeaseApplyInfo">
|
||||
select parent_id as parentId from lease_out_details where ma_id = #{maId} order by create_time desc limit 1
|
||||
select parent_id as parentId,DATE_FORMAT(create_time, '%Y-%m-%d') as leaseTime from lease_out_details where ma_id = #{maId} order by create_time desc limit 1
|
||||
</select>
|
||||
<select id="getLeaseUnitAndProject" resultType="com.bonus.common.biz.domain.lease.LeaseApplyInfo">
|
||||
select
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="isEnter" column="is_enter" />
|
||||
<result property="keeperUserId" column="keep_user_id" />
|
||||
<result property="isCheck" column="is_check" />
|
||||
<result property="jiJuType" column="jiju_type" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="com.bonus.material.ma.domain.vo.MaTypeVo" id="MaTypeVoResult">
|
||||
|
|
@ -176,7 +177,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
GROUP_CONCAT(distinct su2.user_id) as repairerId,
|
||||
hi.house_name,
|
||||
t.sampling_ratio,
|
||||
t.is_check
|
||||
t.is_check,
|
||||
t.jiju_type
|
||||
FROM ma_type AS t
|
||||
left join ma_type mt2 on t.parent_id = mt2.type_id
|
||||
left join ma_type mt3 on mt2.parent_id = mt3.type_id
|
||||
|
|
@ -257,6 +259,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="isTest != null">is_test,</if>
|
||||
<if test="samplingRatio != null">sampling_ratio,</if>
|
||||
<if test="isEnter != null">is_enter,</if>
|
||||
<if test="jiJuType != null">jiJu_type,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="typeName != null and typeName != ''">#{typeName},</if>
|
||||
|
|
@ -293,6 +296,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="isTest != null">#{isTest},</if>
|
||||
<if test="samplingRatio != null">#{samplingRatio},</if>
|
||||
<if test="isEnter != null">#{isEnter},</if>
|
||||
<if test="jiJuType != null">#{jiJuType},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
|
@ -335,6 +339,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="isEnter != null">is_enter = #{isEnter},</if>
|
||||
<if test="keeperUserId != null">keep_user_id = #{keeperUserId},</if>
|
||||
<if test="isCheck != null and isCheck != ''">is_check = #{isCheck},</if>
|
||||
<if test="jiJuType != null and jiJuType != ''">jiJu_type = #{jiJuType},</if>
|
||||
</trim>
|
||||
where type_id = #{typeId}
|
||||
</update>
|
||||
|
|
|
|||
|
|
@ -349,7 +349,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
JOIN ma_type_repair mtr ON mtr.type_id = rad.type_id AND mtr.user_id = #{userId}
|
||||
</if>
|
||||
WHERE
|
||||
tk.task_type = #{taskType}
|
||||
tk.task_type = #{taskType} and tt2.CODE is not null
|
||||
AND tk.create_time < '2025-08-20 00:00:00'
|
||||
<if test="backUnit != null and backUnit != ''">
|
||||
AND bui.unit_id = #{backUnit}
|
||||
|
|
@ -410,7 +410,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
JOIN ma_type_repair mtr ON mtr.type_id = rad.type_id AND mtr.user_id = #{userId}
|
||||
</if>
|
||||
WHERE
|
||||
tk.task_type = #{taskType}
|
||||
tk.task_type = #{taskType} and tt.CODE is not null
|
||||
AND tk.create_time >= '2025-08-20 00:00:00'
|
||||
<if test="backUnit != null and backUnit != ''">
|
||||
AND bui.unit_id = #{backUnit}
|
||||
|
|
|
|||
|
|
@ -1129,6 +1129,144 @@
|
|||
GROUP BY rad.id
|
||||
order by rad.create_time desc
|
||||
</select>
|
||||
<select id="getRepairInspection" resultType="com.bonus.material.repair.domain.vo.RepairInspection">
|
||||
SELECT tt.`code` AS repairCode,
|
||||
bu.unit_name AS backUnitName,
|
||||
bp.pro_name AS projectName,
|
||||
mt2.type_name AS typeName,
|
||||
mt1.type_name AS typeModelName,
|
||||
mt1.sampling_ratio * SUM(rad.repair_num) / 100 AS num,
|
||||
mt1.sampling_ratio AS samplingRatio,
|
||||
mt1.rated_load AS ratedLoad,
|
||||
mt1.test_load AS testLoad,
|
||||
mt1.holding_time AS holdingTime,
|
||||
mm.ma_code AS maCode,
|
||||
mt1.unit_name AS unitName,
|
||||
SUM(rad.repair_num) AS repairNum,
|
||||
SUM(rad.repair_num) AS expNum,
|
||||
rad.task_id AS taskId,
|
||||
rad.type_id AS typeId,
|
||||
rad.ma_id AS maId,
|
||||
rad.create_time AS repairTime
|
||||
FROM repair_apply_details rad
|
||||
LEFT JOIN repair_audit_details rd ON rad.id = rd.repair_id
|
||||
LEFT JOIN tm_task tt ON tt.task_id = rad.task_id
|
||||
LEFT JOIN tm_task_agreement tta ON tta.task_id = tt.task_id
|
||||
LEFT JOIN bm_agreement_info bagi ON bagi.agreement_id = tta.agreement_id
|
||||
AND bagi.`status` = '1'
|
||||
LEFT JOIN bm_project bp ON bp.pro_id = bagi.project_id
|
||||
AND bp.del_flag = '0'
|
||||
LEFT JOIN bm_unit bu ON bu.unit_id = bagi.unit_id
|
||||
AND bu.del_flag = '0'
|
||||
LEFT JOIN ma_type mt1 ON mt1.type_id = rad.type_id
|
||||
AND mt1.del_flag = '0'
|
||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt1.parent_id
|
||||
AND mt2.del_flag = '0'
|
||||
LEFT JOIN ma_machine mm ON rad.ma_id = mm.ma_id
|
||||
WHERE rd.`status` = '1'
|
||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
<![CDATA[and DATE_FORMAT( rad.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
|
||||
</if>
|
||||
<if test="unitId != null and unitId != ''">
|
||||
and bu.unit_id = #{unitId}
|
||||
</if>
|
||||
<if test="proId != null and proId != ''">
|
||||
and bp.pro_id = #{proId}
|
||||
</if>
|
||||
<if test="typeName != null and typeName != ''">
|
||||
and mt2.type_name like CONCAT('%', #{typeName}, '%')
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (mt2.type_name like CONCAT('%', #{keyWord}, '%') OR tt.`code` like CONCAT('%', #{keyWord}, '%') OR
|
||||
mt1.type_name like CONCAT('%', #{keyWord}, '%'))
|
||||
</if>
|
||||
GROUP BY typeName, typeModelName, repairCode
|
||||
</select>
|
||||
<select id="getTestRecord" resultType="com.bonus.material.repair.domain.vo.TestRecord">
|
||||
SELECT
|
||||
rad.id AS id,
|
||||
tt.`code` AS repairCode,
|
||||
bu.unit_name AS backUnitName,
|
||||
bp.pro_name AS projectName,
|
||||
mt2.type_name AS typeName,
|
||||
mt1.type_name AS typeModelName,
|
||||
rad.create_time AS repairTime ,
|
||||
mm.ma_code AS maCode
|
||||
FROM
|
||||
repair_apply_details rad
|
||||
LEFT JOIN repair_audit_details rd ON rad.id = rd.repair_id
|
||||
LEFT JOIN tm_task tt ON tt.task_id = rad.task_id
|
||||
LEFT JOIN tm_task_agreement tta ON tta.task_id = tt.task_id
|
||||
LEFT JOIN bm_agreement_info bagi ON bagi.agreement_id = tta.agreement_id
|
||||
AND bagi.`status` = '1'
|
||||
LEFT JOIN bm_project bp ON bp.pro_id = bagi.project_id
|
||||
AND bp.del_flag = '0'
|
||||
LEFT JOIN bm_unit bu ON bu.unit_id = bagi.unit_id
|
||||
AND bu.del_flag = '0'
|
||||
LEFT JOIN ma_type mt1 ON mt1.type_id = rad.type_id
|
||||
AND mt1.del_flag = '0'
|
||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt1.parent_id
|
||||
AND mt2.del_flag = '0'
|
||||
LEFT JOIN ma_machine mm ON rad.ma_id = mm.ma_id
|
||||
WHERE
|
||||
rd.`status` = '1' and mt1.manage_type='0'
|
||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
<![CDATA[and DATE_FORMAT( rad.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
|
||||
</if>
|
||||
<if test="unitId != null and unitId != ''">
|
||||
and bu.unit_id = #{unitId}
|
||||
</if>
|
||||
<if test="proId != null and proId != ''">
|
||||
and bp.pro_id = #{proId}
|
||||
</if>
|
||||
<if test="typeName != null and typeName != ''">
|
||||
and mt2.type_name like CONCAT('%', #{typeName}, '%')
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (mt2.type_name like CONCAT('%', #{keyWord}, '%') OR tt.`code` like CONCAT('%', #{keyWord}, '%') OR
|
||||
mt1.type_name like CONCAT('%', #{keyWord}, '%') OR mm.ma_code like CONCAT('%', #{keyWord}, '%'))
|
||||
</if>
|
||||
GROUP BY typeName, typeModelName, repairCode,maCode
|
||||
</select>
|
||||
<select id="getTestRecordDetails" resultType="com.bonus.material.repair.domain.RepairTaskDetails">
|
||||
SELECT
|
||||
rad.id,
|
||||
rad.type_id as typeId,
|
||||
mt.type_name as type,
|
||||
mt2.type_name as typeName,
|
||||
CONCAT(bai.`code`, '-', rad.`level`) as `code`,
|
||||
mm.ma_code as maCode,
|
||||
su.nick_name as repairer,
|
||||
DATE_FORMAT(rad.update_time,'%Y-%m-%d') as createTime,
|
||||
mt.rated_load as ratedLoad,
|
||||
mt.test_load as testLoad,
|
||||
mt.holding_time as holdingTime,
|
||||
rad.scrap_num as scrapNum
|
||||
FROM
|
||||
repair_apply_details rad
|
||||
LEFT JOIN ma_type mt on mt.type_id=rad.type_id
|
||||
LEFT JOIN ma_type mt2 on mt2.type_id=mt.parent_id
|
||||
LEFT JOIN back_apply_info bai on bai.id=rad.back_id
|
||||
LEFT JOIN ma_machine mm on mm.ma_id=rad.ma_id
|
||||
LEFT JOIN sys_user su on su.user_id=rad.repairer
|
||||
WHERE
|
||||
rad.id=#{id}
|
||||
</select>
|
||||
<select id="getPartDetails" resultType="com.bonus.material.ma.domain.PartType">
|
||||
SELECT rar.part_id as id,
|
||||
mpt2.pa_name as partName
|
||||
|
||||
FROM repair_apply_record rar
|
||||
LEFT JOIN repair_apply_details rad
|
||||
on rad.task_id = rar.task_id and rad.type_id = rar.type_id and rad.ma_id = rar.ma_id
|
||||
LEFT JOIN ma_part_type mpt on mpt.pa_id = rar.part_id
|
||||
LEFT JOIN ma_part_type mpt2 on mpt2.pa_id = mpt.parent_id
|
||||
LEFT JOIN ma_part_type mpt3 on mpt2.parent_id = mpt.parent_id
|
||||
WHERE rad.id = #{id}
|
||||
and rar.is_ds = 0
|
||||
and rar.part_id IS NOT NULL
|
||||
and mpt2.pa_name IS NOT NULL
|
||||
</select>
|
||||
|
||||
<update id="updateRepairedAndScrapNum">
|
||||
update
|
||||
|
|
@ -1181,4 +1319,24 @@
|
|||
where
|
||||
id=#{id}
|
||||
</update>
|
||||
<update id="updateMaMachine">
|
||||
UPDATE ma_machine
|
||||
SET this_check_time = NOW(),
|
||||
next_check_time = DATE_SUB(DATE_ADD(NOW(), INTERVAL 1 YEAR), INTERVAL 1 DAY),
|
||||
check_man = #{userName},
|
||||
update_time = NOW()
|
||||
WHERE ma_id IN (
|
||||
SELECT DISTINCT rad.ma_id
|
||||
FROM repair_apply_details rad
|
||||
INNER JOIN ma_type mt ON mt.type_id = rad.type_id
|
||||
WHERE mt.manage_type = 0
|
||||
AND mt.jiju_type = 1
|
||||
AND rad.id IN
|
||||
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
||||
)
|
||||
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -87,6 +87,14 @@
|
|||
LEFT JOIN sys_workflow_node wn2 on wc.node_id = wn2.id
|
||||
WHERE wh.record_id = #{flowId}
|
||||
</select>
|
||||
<select id="getImpUnit" resultType="java.lang.Integer">
|
||||
select
|
||||
imp_unit as impUnit
|
||||
from
|
||||
bm_project
|
||||
where
|
||||
pro_id = #{proId}
|
||||
</select>
|
||||
|
||||
<update id="updateWorkflowRecord">
|
||||
update sys_workflow_record set workflow_status = #{flowStatus} where id = #{id}
|
||||
|
|
|
|||
|
|
@ -40,20 +40,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="selectRolesByNodeId" resultType="java.lang.String">
|
||||
select roleIds from sys_workflow_config where node_id = #{nodeId}
|
||||
</select>
|
||||
|
||||
<select id="selectUnitConfigValuesByTaskId" resultType="java.lang.String">
|
||||
SELECT
|
||||
select roleIds from sys_workflow_config where node_id = #{nodeId} SELECT
|
||||
GROUP_CONCAT(su.user_id) configValue
|
||||
FROM
|
||||
direct_apply_info dai
|
||||
LEFT JOIN bm_agreement_info bai ON dai.lease_agreement_id = bai.agreement_id
|
||||
LEFT JOIN bm_project bp ON bai.project_id = bp.pro_id
|
||||
LEFT JOIN data_center.dx_fb_son dfs ON dfs.`ID` = bp.external_id
|
||||
LEFT JOIN sbd_audit.sg_project_post_personnel sppp ON sppp.depart_id = dfs.`project dept id`
|
||||
LEFT JOIN sbd_audit.sg_project_post_personnel sppp ON sppp.depart_id = dfs.`project_dept_id`
|
||||
LEFT JOIN sys_user su ON su.user_name = sppp.cno
|
||||
WHERE
|
||||
dai.id = #{taskId}
|
||||
</select>
|
||||
|
||||
<select id="selectUnitConfigValuesByTaskId" resultType="java.lang.String">
|
||||
|
||||
</select>
|
||||
<select id="getImpUnit" resultType="java.lang.Integer">
|
||||
select
|
||||
imp_unit as impUnit
|
||||
from
|
||||
bm_project
|
||||
where
|
||||
pro_id = #{proId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -28,9 +28,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and task_type = #{taskType}
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateSysWorkflowType">
|
||||
update sys_workflow_record set workflow_id = #{workflowId} where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<select id="getSysWorkflowRecodeByTaskId" parameterType="Integer" resultType="com.bonus.material.work.domain.dto.SysWorkflowAuditDto">
|
||||
<select id="getSysWorkflowRecodeByTaskId" parameterType="Integer" resultType="com.bonus.material.work.domain.dto.SysWorkflowAuditDto">
|
||||
select
|
||||
a.task_id as taskId,
|
||||
a.task_type as taskType,
|
||||
|
|
|
|||
Loading…
Reference in New Issue