Merge remote-tracking branch 'origin/master'

This commit is contained in:
itcast 2026-01-09 10:13:49 +08:00
commit 890934ada4
30 changed files with 431 additions and 41 deletions

View File

@ -109,4 +109,7 @@ public class MaCodeVo {
@ApiModelProperty("是否提示 当前工器具仍有班组在用,请核实退料单位")
private Boolean isAlert = false;
@ApiModelProperty(value = "组织id")
private Long companyId;
}

View File

@ -7,6 +7,7 @@ import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.web.page.TableDataInfo;
import com.bonus.material.lossAssessment.service.LossAssessmentService;
import com.bonus.material.ma.service.ITypeService;
import com.bonus.material.repair.domain.RepairPartDetails;
import com.bonus.material.repair.domain.RepairTask;
import com.bonus.material.repair.domain.RepairTaskDetails;
@ -34,6 +35,9 @@ public class LossAssessmentController extends BaseController {
@Resource
private LossAssessmentService service;
@Resource
private ITypeService typeService;
/**
* 获取定损任务列表
*/
@ -42,6 +46,8 @@ public class LossAssessmentController extends BaseController {
public AjaxResult getLossAssessmentList(RepairTask bean) {
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
Long deptId = typeService.getUserDeptId();
bean.setCompanyId(deptId);
List<RepairTask> list = service.getLossAssessmentList(bean);
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
}
@ -52,6 +58,8 @@ public class LossAssessmentController extends BaseController {
@ApiOperation(value = "定损详情列表")
@GetMapping("/getLossAssessmentDetailsList")
public AjaxResult getLossAssessmentDetailsList(RepairTaskDetails bean) {
Long deptId = typeService.getUserDeptId();
bean.setCompanyId(deptId);
List<RepairDeviceSummaryVo> list = service.getLossAssessmentDetailsList(bean);
return AjaxResult.success(list);
}

View File

@ -17,6 +17,7 @@ import com.bonus.material.lossAssessment.mapper.LossAssessmentMapper;
import com.bonus.material.lossAssessment.service.LossAssessmentService;
import com.bonus.material.ma.domain.PartType;
import com.bonus.material.ma.mapper.MachineMapper;
import com.bonus.material.ma.service.ITypeService;
import com.bonus.material.repair.domain.*;
import com.bonus.material.repair.domain.vo.RepairDeviceSummaryVo;
import com.bonus.material.repair.domain.vo.RepairDeviceVO;
@ -61,6 +62,9 @@ public class LossAssessmentServiceImpl implements LossAssessmentService {
@Resource
private MachineMapper machineMapper;
@Resource
private ITypeService typeService;
@Override
public List<RepairTask> getLossAssessmentList(RepairTask bean) {
@ -279,8 +283,14 @@ public class LossAssessmentServiceImpl implements LossAssessmentService {
* 处理配件集合数据
*/
private void processAccessoryCollectionData(RepairDeviceVO bean) {
Long deptId = typeService.getUserDeptId();
//配件集合
List<RepairPartDetails> partList = bean.getCodeInRepairPartList();
List<RepairPartDetails> partList = new ArrayList<>();
if (bean.getManageType()==0){
partList = bean.getCodeInRepairPartList();
} else {
partList = bean.getNumberInRepairPartList();
}
//去除无效数据
List<RepairPartDetails> validPartList = partList.stream()
.filter(partDetails -> !(null == partDetails.getPartId() && partDetails.getPartPrice() == null))
@ -311,6 +321,7 @@ public class LossAssessmentServiceImpl implements LossAssessmentService {
repairApplyRecord.setRepairNum(dsNum);
}
repairApplyRecord.setRepairType(RepairTypeEnum.INNER_REPAIR.getTypeId());
repairApplyRecord.setCompanyId(deptId);
//新增定损费用记录表
mapper.addRepairCost(repairApplyRecord, sfCosts, "1");
} else {
@ -324,6 +335,7 @@ public class LossAssessmentServiceImpl implements LossAssessmentService {
repairApplyRecord.setRepairNum(BigDecimal.valueOf(!RepairTypeEnum.TO_SCRAP.getTypeId().equals(bean.getRepairType()) ? 1 : 0));
repairApplyRecord.setScrapNum(BigDecimal.valueOf(RepairTypeEnum.TO_SCRAP.getTypeId().equals(bean.getRepairType()) ? 1 : 0));
repairApplyRecord.setCreateBy(SecurityUtils.getLoginUser().getUsername());
repairApplyRecord.setCompanyId(deptId);
//添加维修记录表数据
addRepairRecord(repairApplyRecord);
}
@ -334,6 +346,7 @@ public class LossAssessmentServiceImpl implements LossAssessmentService {
* 增加维修记录
*/
private void insertRepairRecord(RepairDeviceVO bean,RepairPartDetails partDetails) {
Long deptId = typeService.getUserDeptId();
LoginUser loginUser = SecurityUtils.getLoginUser();
RepairApplyRecord repairApplyRecord = new RepairApplyRecord();
repairApplyRecord.setTaskId(bean.getTaskId());
@ -342,6 +355,7 @@ public class LossAssessmentServiceImpl implements LossAssessmentService {
repairApplyRecord.setRepairType(RepairTypeEnum.INNER_REPAIR.getTypeId());
if (bean.getManageType()==0){
repairApplyRecord.setRepairNum(BigDecimal.valueOf(1));
partDetails.setDsNum(BigDecimal.valueOf(1));
} else {
repairApplyRecord.setRepairNum(partDetails.getDsNum());
}
@ -352,7 +366,7 @@ public class LossAssessmentServiceImpl implements LossAssessmentService {
partDetails.setTaskId(bean.getTaskId());
partDetails.setMaId(bean.getMaId());
partDetails.setTypeId(bean.getTypeId());
partDetails.setCompanyId(null);
partDetails.setCompanyId(deptId);
partDetails.setCreateBy(String.valueOf(loginUser.getUserid()));
if (partDetails.getPartPrice()==null && partDetails.getPartId()!=null){
// 根据 partId 找配件单价
@ -360,6 +374,7 @@ public class LossAssessmentServiceImpl implements LossAssessmentService {
// 设置配件单价费用
partDetails.setPartPrice(partPrice);
}
partDetails.setPartType(1);
//添加维修配件明细表数据
addRepairPartDetails(partDetails);
repairApplyRecord.setId(bean.getId());
@ -368,6 +383,7 @@ public class LossAssessmentServiceImpl implements LossAssessmentService {
repairApplyRecord.setRepairContent(partDetails.getRepairContent());
repairApplyRecord.setPartType(1);
repairApplyRecord.setPartId(Optional.ofNullable(partDetails.getPartId()).orElse(0L));
repairApplyRecord.setCompanyId(deptId);
//添加维修记录表数据
addRepairRecord(repairApplyRecord);
}

View File

@ -238,6 +238,7 @@ public class TypeServiceImpl implements ITypeService {
// 获取锁公平锁会按线程等待请求顺序分配锁
lock.lock();
try {
Long deptId = getUserDeptId();
int result = 0;
// 根据typeId查询物资名称和规格型号
Type info = typeMapper.selectTypeByTypeId(type.getTypeId());
@ -267,6 +268,7 @@ public class TypeServiceImpl implements ITypeService {
result = typeMapper.updateMaTypeStockNum(type);
if (result > 0) {
type.setStorageNum(type.getPreStoreNum().subtract(type.getOutNum()));
type.setCompanyId(deptId);
typeMapper.insertStorageNumLog(type);
} else {
throw new RuntimeException("更新库存失败");
@ -275,6 +277,7 @@ public class TypeServiceImpl implements ITypeService {
result = typeMapper.updateStorageNum(type);
if (result > 0) {
type.setModelTitle("直接修改库存");
type.setCompanyId(deptId);
typeMapper.insertStorageNumLog(type);
} else {
throw new RuntimeException("更新库存失败");
@ -283,6 +286,7 @@ public class TypeServiceImpl implements ITypeService {
result = typeMapper.addStockNum(type);
if (result > 0) {
type.setStorageNum(type.getPreStoreNum().add(type.getInputNum()));
type.setCompanyId(deptId);
typeMapper.insertStorageNumLog(type);
} else {
throw new RuntimeException("更新库存失败");
@ -295,11 +299,13 @@ public class TypeServiceImpl implements ITypeService {
}else{
type.setInputType(1);
}
type.setCompanyId(deptId);
typeMapper.insertBmStorageNumLog(type);
}
} catch (Exception e) {
type.setResultMsg("操作失败");
type.setStatus(1);
type.setCompanyId(deptId);
typeMapper.insertBmStorageNumLog(type);
throw new RuntimeException("更新库存失败");
}

View File

@ -1,9 +1,11 @@
package com.bonus.material.repair.controller;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import com.bonus.common.log.enums.OperaType;
import com.bonus.material.common.annotation.PreventRepeatSubmit;
import com.bonus.material.ma.service.ITypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
@ -37,6 +39,9 @@ public class RepairApplyDetailsController extends BaseController {
@Autowired
private IRepairApplyDetailsService repairApplyDetailsService;
@Resource
private ITypeService typeService;
/**
* 查询维修详细列表
*/
@ -45,6 +50,8 @@ public class RepairApplyDetailsController extends BaseController {
@GetMapping("/list")
public TableDataInfo list(RepairApplyDetails repairApplyDetails) {
startPage();
Long deptId = typeService.getUserDeptId();
repairApplyDetails.setCompanyId(deptId);
List<RepairApplyDetails> list = repairApplyDetailsService.selectRepairApplyDetailsList(repairApplyDetails);
return getDataTable(list);
}
@ -58,6 +65,8 @@ public class RepairApplyDetailsController extends BaseController {
@SysLog(title = "维修详细", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出维修详细")
@PostMapping("/export")
public void export(HttpServletResponse response, RepairApplyDetails repairApplyDetails) {
Long deptId = typeService.getUserDeptId();
repairApplyDetails.setCompanyId(deptId);
List<RepairApplyDetails> list = repairApplyDetailsService.selectRepairApplyDetailsList(repairApplyDetails);
ExcelUtil<RepairApplyDetails> util = new ExcelUtil<RepairApplyDetails>(RepairApplyDetails.class);
util.exportExcel(response, list, "维修详细数据");
@ -83,6 +92,8 @@ public class RepairApplyDetailsController extends BaseController {
@PostMapping
public AjaxResult add(@RequestBody RepairApplyDetails repairApplyDetails) {
try {
Long deptId = typeService.getUserDeptId();
repairApplyDetails.setCompanyId(deptId);
return toAjax(repairApplyDetailsService.insertRepairApplyDetails(repairApplyDetails));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());

View File

@ -5,6 +5,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import com.bonus.common.log.enums.OperaType;
import com.bonus.material.common.annotation.PreventRepeatSubmit;
import com.bonus.material.ma.service.ITypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
@ -37,6 +38,9 @@ public class RepairApplyRecordController extends BaseController {
@Resource
private IRepairApplyRecordService repairApplyRecordService;
@Resource
private ITypeService typeService;
/**
* 查询维修记录列表
*/
@ -45,6 +49,8 @@ public class RepairApplyRecordController extends BaseController {
@GetMapping("/list")
public TableDataInfo list(RepairApplyRecord repairApplyRecord) {
startPage();
Long deptId = typeService.getUserDeptId();
repairApplyRecord.setCompanyId(deptId);
List<RepairApplyRecord> list = repairApplyRecordService.selectRepairApplyRecordList(repairApplyRecord);
return getDataTable(list);
}
@ -58,6 +64,8 @@ public class RepairApplyRecordController extends BaseController {
@SysLog(title = "维修记录", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出维修记录")
@PostMapping("/export")
public void export(HttpServletResponse response, RepairApplyRecord repairApplyRecord) {
Long deptId = typeService.getUserDeptId();
repairApplyRecord.setCompanyId(deptId);
List<RepairApplyRecord> list = repairApplyRecordService.selectRepairApplyRecordList(repairApplyRecord);
ExcelUtil<RepairApplyRecord> util = new ExcelUtil<RepairApplyRecord>(RepairApplyRecord.class);
util.exportExcel(response, list, "维修记录数据");
@ -83,6 +91,8 @@ public class RepairApplyRecordController extends BaseController {
@PostMapping
public AjaxResult add(@RequestBody RepairApplyRecord repairApplyRecord) {
try {
Long deptId = typeService.getUserDeptId();
repairApplyRecord.setCompanyId(deptId);
return toAjax(repairApplyRecordService.insertRepairApplyRecord(repairApplyRecord));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());

View File

@ -17,6 +17,7 @@ import com.bonus.common.log.enums.OperaType;
import com.bonus.material.basic.domain.report.LeaseOutInfo;
import com.bonus.material.basic.domain.report.PurChaseReportInfo;
import com.bonus.material.common.annotation.PreventRepeatSubmit;
import com.bonus.material.ma.service.ITypeService;
import com.bonus.material.repair.domain.RepairPart;
import com.bonus.material.repair.domain.RepairRecord;
import com.bonus.material.repair.domain.vo.RepairHomeInfo;
@ -55,6 +56,9 @@ public class RepairAuditDetailsController extends BaseController {
@Resource
private IRepairAuditDetailsService repairAuditDetailsService;
@Resource
private ITypeService typeService;
/**
* 查询修试审核任务列表
@ -66,6 +70,8 @@ public class RepairAuditDetailsController extends BaseController {
public AjaxResult questList(RepairAuditDetails repairAuditDetails) {
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
Long deptId = typeService.getUserDeptId();
repairAuditDetails.setCompanyId(Math.toIntExact(deptId));
List<ScrapApplyDetailsVO> list = repairAuditDetailsService.selectRepairQuestList(repairAuditDetails);
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
}
@ -96,6 +102,8 @@ public class RepairAuditDetailsController extends BaseController {
bean.setTaskType(TM_TASK_REPAIR_AUDIT.getTaskTypeId());
}
repairAuditDetailsService.queryTimeCope(bean);
Long deptId = typeService.getUserDeptId();
bean.setCompanyId(Math.toIntExact(deptId));
List<ScrapApplyDetailsVO> list = repairAuditDetailsService.selectRepairQuestList(bean);
// List<ScrapApplyDetailsVO> newList = new ArrayList<>();
// list.forEach(item -> {
@ -136,6 +144,8 @@ public class RepairAuditDetailsController extends BaseController {
@GetMapping("/getRepairRecord")
public TableDataInfo getRepairRecord(RepairAuditDetails repairAuditDetails) {
startPage();
Long deptId = typeService.getUserDeptId();
repairAuditDetails.setCompanyId(Math.toIntExact(deptId));
List<RepairRecord> list = repairAuditDetailsService.getRepairRecord(repairAuditDetails);
return getDataTable(list);
}
@ -147,6 +157,8 @@ public class RepairAuditDetailsController extends BaseController {
@GetMapping("/getPartRecord")
public TableDataInfo getPartRecord(RepairAuditDetails repairAuditDetails) {
startPage();
Long deptId = typeService.getUserDeptId();
repairAuditDetails.setCompanyId(Math.toIntExact(deptId));
List<RepairPart> list = repairAuditDetailsService.getPartRecord(repairAuditDetails);
return getDataTable(list);
}
@ -175,6 +187,8 @@ public class RepairAuditDetailsController extends BaseController {
@GetMapping("/list")
public TableDataInfo list(RepairAuditDetails repairAuditDetails) {
startPage();
Long deptId = typeService.getUserDeptId();
repairAuditDetails.setCompanyId(Math.toIntExact(deptId));
List<RepairAuditDetails> list = repairAuditDetailsService.selectRepairAuditDetailsList(repairAuditDetails);
return getDataTable(list);
}
@ -188,6 +202,8 @@ public class RepairAuditDetailsController extends BaseController {
@SysLog(title = "修试审核详细", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出修试审核详细")
@PostMapping("/exportEasyExcel")
public void export(HttpServletResponse response, RepairAuditDetails repairAuditDetails) {
Long deptId = typeService.getUserDeptId();
repairAuditDetails.setCompanyId(Math.toIntExact(deptId));
List<RepairAuditDetails> list = repairAuditDetailsService.selectRepairAuditDetailsList(repairAuditDetails);
ExcelUtil<RepairAuditDetails> util = new ExcelUtil<>(RepairAuditDetails.class);
util.exportExcel(response, list, "修试审核详细数据");
@ -213,6 +229,8 @@ public class RepairAuditDetailsController extends BaseController {
@PostMapping
public AjaxResult add(@RequestBody RepairAuditDetails repairAuditDetails) {
try {
Long deptId = typeService.getUserDeptId();
repairAuditDetails.setCompanyId(Math.toIntExact(deptId));
return toAjax(repairAuditDetailsService.insertRepairAuditDetails(repairAuditDetails));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());
@ -280,6 +298,8 @@ public class RepairAuditDetailsController extends BaseController {
dto.setIsExport(1);
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
Long deptId = typeService.getUserDeptId();
dto.setCompanyId(deptId);
List<RepairHomeInfo> pageList = repairAuditDetailsService.getRepairHomeList(dto);
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, pageList));
} catch (Exception e) {
@ -296,7 +316,9 @@ public class RepairAuditDetailsController extends BaseController {
@GetMapping("/getRepairHomeTotalList")
public AjaxResult getRepairHomeTotalList(RepairHomeInfo dto) {
try {
Long deptId = typeService.getUserDeptId();
dto.setIsExport(0);
dto.setCompanyId(deptId);
List<RepairHomeInfo> pageList = repairAuditDetailsService.getRepairHomeTotalList(dto);
return AjaxResult.success(pageList);
} catch (Exception e) {
@ -313,7 +335,9 @@ public class RepairAuditDetailsController extends BaseController {
@PostMapping("/exportRepairHomeList")
public void exportRepairHomeList(HttpServletResponse response, RepairHomeInfo dto)
{
Long deptId = typeService.getUserDeptId();
dto.setIsExport(0);
dto.setCompanyId(deptId);
List<RepairHomeInfo> list = repairAuditDetailsService.getRepairHomeList(dto);
ExcelUtil<RepairHomeInfo> util = new ExcelUtil<>(RepairHomeInfo.class);
util.exportExcel(response, list, "修饰一览表");

View File

@ -19,6 +19,7 @@ import com.bonus.material.basic.domain.ProjUsingRecord;
import com.bonus.material.basic.domain.ProjUsingRecordExport;
import com.bonus.material.common.annotation.PreventRepeatSubmit;
import com.bonus.material.ma.domain.LabelBind;
import com.bonus.material.ma.service.ITypeService;
import com.bonus.material.repair.domain.*;
import com.bonus.material.repair.domain.vo.*;
import com.bonus.material.repair.service.IRepairAuditDetailsService;
@ -55,6 +56,9 @@ public class RepairController extends BaseController {
@Resource
private IRepairAuditDetailsService repairAuditDetailsService;
@Resource
private ITypeService typeService;
/**
* Jackson -- 避免反序列化漏洞
*/
@ -69,6 +73,8 @@ public class RepairController extends BaseController {
public AjaxResult getRepairTaskList(RepairTask bean) {
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
Long deptId = typeService.getUserDeptId();
bean.setCompanyId(deptId);
List<RepairTask> list = service.getRepairTaskList(bean);
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
}
@ -84,6 +90,8 @@ public class RepairController extends BaseController {
//@RequiresPermissions(value = "repair:manage:list")
public TableDataInfo getDetailsList(RepairPartDetails bean) {
startPage();
Long deptId = typeService.getUserDeptId();
bean.setCompanyId(deptId);
List<RepairPartDetails> list = service.getDetailsList(bean);
return getDataTable(list);
}
@ -99,6 +107,8 @@ public class RepairController extends BaseController {
//@RequiresPermissions(value = "repair:manage:list")
public TableDataInfo getDetailsListApp(RepairPartDetails bean) {
startPage();
Long deptId = typeService.getUserDeptId();
bean.setCompanyId(deptId);
List<RepairPartDetails> list = service.getDetailsListApp(bean);
return getDataTable(list);
}
@ -110,6 +120,8 @@ public class RepairController extends BaseController {
@GetMapping("/getAppRepairTaskList")
//@RequiresPermissions("repair:manage:list")
public AjaxResult getAppRepairTaskList(RepairTask bean) {
Long deptId = typeService.getUserDeptId();
bean.setCompanyId(deptId);
List<RepairTask> list = service.getRepairTaskList(bean);
return AjaxResult.success(list);
}
@ -121,6 +133,8 @@ public class RepairController extends BaseController {
//@RequiresPermissions(value = "repair:manage:list")
@GetMapping("/getAppRepairMaTypeList")
public AjaxResult getAppRepairMaTypeList(RepairTaskDetails bean) {
Long deptId = typeService.getUserDeptId();
bean.setCompanyId(deptId);
List<RepairDeviceSummaryVo> list = service.getRepairDeviceSummary(bean);
return AjaxResult.success(list);
}
@ -134,6 +148,8 @@ public class RepairController extends BaseController {
//@RequiresPermissions(value = "repair:manage:list")
@GetMapping("/getRepairDetailsList")
public AjaxResult getRepairDetailsList(RepairTaskDetails bean) {
Long deptId = typeService.getUserDeptId();
bean.setCompanyId(deptId);
List<RepairDeviceSummaryVo> list = service.getRepairDetailsList(bean);
return AjaxResult.success(list);
}
@ -144,6 +160,8 @@ public class RepairController extends BaseController {
@ApiOperation(value = "维修已完成--Ⅱ级页面详情列表")
@GetMapping("/getAppRepairMaTypeListNew")
public AjaxResult getAppRepairMaTypeListNew(RepairTaskDetails bean) {
Long deptId = typeService.getUserDeptId();
bean.setCompanyId(deptId);
List<RepairDeviceSummaryVo> list = service.getAppRepairMaTypeListNew(bean);
return AjaxResult.success(list);
}
@ -155,6 +173,8 @@ public class RepairController extends BaseController {
//@RequiresPermissions(value = "repair:manage:list")
@GetMapping("/getAppRepairMaTypeListByTaskIdAndTypeId")
public AjaxResult getAppRepairMaTypeListByTaskIdAndTypeId(RepairTaskDetails bean) {
Long deptId = typeService.getUserDeptId();
bean.setCompanyId(deptId);
List<RepairDeviceVO> list = service.getAppRepairMaTypeListByTaskIdAndTypeId(bean);
return AjaxResult.success(list);
}
@ -165,6 +185,8 @@ public class RepairController extends BaseController {
@ApiOperation(value = "获取维修任务机具列表--三级页面详情列表--编码")
@GetMapping("/getRepairCodeList")
public AjaxResult getRepairCodeList(RepairTaskDetails bean) {
Long deptId = typeService.getUserDeptId();
bean.setCompanyId(deptId);
List<RepairTaskDetails> list = service.getRepairCodeList(bean);
return AjaxResult.success(list);
}
@ -175,6 +197,8 @@ public class RepairController extends BaseController {
@ApiOperation(value = "查询试验记录表数据")
@GetMapping("/getTestRecordData")
public AjaxResult getTestRecordData(RepairTaskDetails bean) {
Long deptId = typeService.getUserDeptId();
bean.setCompanyId(deptId);
List<RepairTaskDetails> list = service.getTestRecordData(bean);
return AjaxResult.success(list);
}
@ -197,6 +221,8 @@ public class RepairController extends BaseController {
@PostMapping("/submitRepairApply")
public AjaxResult submitRepairApply(@RequestBody @NotNull RepairApplyRecord bean) {
try {
Long deptId = typeService.getUserDeptId();
bean.setCompanyId(deptId);
String partStrList = bean.getPartStrList();
if (StringUtils.isNoneBlank(partStrList)) {
List<RepairPartDetails> repairPartDetails = objectMapper.readValue(partStrList, new TypeReference<List<RepairPartDetails>>() {
@ -261,7 +287,10 @@ public class RepairController extends BaseController {
*/
@GetMapping("/getUserSelect")
public AjaxResult getUserSelect() {
List<SysUser> list = service.selectUserList();
Long deptId = typeService.getUserDeptId();
SysUser user = new SysUser();
user.setCompanyId(deptId);
List<SysUser> list = service.selectUserList(user);
return AjaxResult.success(list);
}
@ -274,6 +303,8 @@ public class RepairController extends BaseController {
public void export(HttpServletResponse response, RepairTask bean) {
List<RepairTask> list = new ArrayList<>();
try {
Long deptId = typeService.getUserDeptId();
bean.setCompanyId(deptId);
list = service.getRepairTaskList(bean);
} catch (Exception e) {
list = new ArrayList<>();
@ -287,6 +318,8 @@ public class RepairController extends BaseController {
//@RequiresPermissions("warehousing:repair:list")
public TableDataInfo getRepairedList(RepairInputDetailsVo dto) {
startPage();
Long deptId = typeService.getUserDeptId();
dto.setCompanyId(deptId);
List<RepairInputDetailsVo> list = service.getRepairedList(dto);
return getDataTable(list);
}
@ -296,6 +329,8 @@ public class RepairController extends BaseController {
//@RequiresPermissions("warehousing:repair:list")
public TableDataInfo getRepairedDetailList(RepairInputDetailsVo dto) {
startPage();
Long deptId = typeService.getUserDeptId();
dto.setCompanyId(deptId);
List<RepairInputDetailsVo> list = service.getRepairedDetailList(dto);
return getDataTable(list);
}
@ -328,6 +363,8 @@ public class RepairController extends BaseController {
public AjaxResult selectRepairPartList(RepairPartVo dto) {
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
Long deptId = typeService.getUserDeptId();
dto.setCompanyId(deptId);
List<RepairPartVo> list = service.selectRepairPartList(dto);
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
}
@ -340,6 +377,8 @@ public class RepairController extends BaseController {
*/
@PostMapping("/exportRepairPartList")
public void exportBackApplyList(HttpServletResponse response, RepairPartVo dto) {
Long deptId = typeService.getUserDeptId();
dto.setCompanyId(deptId);
List<RepairPartVo> list = service.selectRepairPartList(dto);
ExcelUtil<RepairPartVo> util = new ExcelUtil<RepairPartVo>(RepairPartVo.class);
util.exportExcel(response, list, "退维修配件查询数据");
@ -356,6 +395,8 @@ public class RepairController extends BaseController {
public AjaxResult selectSecondRepairPartList(RepairPartInfo dto) {
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
Long deptId = typeService.getUserDeptId();
dto.setCompanyId(deptId);
List<RepairPartInfo> list = service.selectSecondRepairPartList(dto);
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
}
@ -376,6 +417,8 @@ public class RepairController extends BaseController {
public TableDataInfo getRepairInspection(RepairInspection dto) {
try {
startPage();
Long deptId = typeService.getUserDeptId();
dto.setCompanyId(deptId);
List<RepairInspection> list = service.getRepairInspection(dto);
return getDataTable(list);
} catch (Exception e) {
@ -392,6 +435,8 @@ public class RepairController extends BaseController {
@SysLog(title = "机具设备标签", businessType = OperaType.EXPORT, logType = 1, module = "仓储管理->导出维修检验试验报表")
@PostMapping("/getRepairInspectionExport")
public void getRepairInspectionExport(HttpServletResponse response, RepairInspection dto) {
Long deptId = typeService.getUserDeptId();
dto.setCompanyId(deptId);
List<RepairInspection> list = service.getRepairInspection(dto);
ExcelUtil<RepairInspection> util = new ExcelUtil<RepairInspection>(RepairInspection.class);
util.exportExcel(response, list, "机具设备标签数据");
@ -403,6 +448,8 @@ public class RepairController extends BaseController {
public TableDataInfo getTestRecord(TestRecord dto) {
try {
startPage();
Long deptId = typeService.getUserDeptId();
dto.setCompanyId(deptId);
List<TestRecord> list = service.getTestRecord(dto);
return getDataTable(list);
} catch (Exception e) {
@ -420,6 +467,8 @@ public class RepairController extends BaseController {
@SysLog(title = "机具设备标签", businessType = OperaType.EXPORT, logType = 1, module = "仓储管理->导出维修检验试验报表")
@PostMapping("/getTestRecordExport")
public void getTestRecordExport(HttpServletResponse response, TestRecord dto) {
Long deptId = typeService.getUserDeptId();
dto.setCompanyId(deptId);
List<TestRecord> list = service.getTestRecord(dto);
ExcelUtil<TestRecord> util = new ExcelUtil<TestRecord>(TestRecord.class);
util.exportExcel(response, list, "机具设备标签数据");
@ -431,6 +480,8 @@ public class RepairController extends BaseController {
@ApiOperation(value = "查询试验记录表数据")
@GetMapping("/getTestRecordDetails")
public AjaxResult getTestRecordDetails(TestRecord bean) {
Long deptId = typeService.getUserDeptId();
bean.setCompanyId(deptId);
List<RepairTaskDetails> list = service.getTestRecordDetails(bean);
return AjaxResult.success(list);
}
@ -444,6 +495,8 @@ public class RepairController extends BaseController {
@GetMapping("/getRepairProjectList")
public AjaxResult getRepairProjectList(RepairProjectInfo bean) {
startPage();
Long deptId = typeService.getUserDeptId();
bean.setCompanyId(deptId);
List<RepairProjectInfo> list = service.getRepairProjectList(bean);
return AjaxResult.success(getDataTable(list));
}
@ -456,6 +509,8 @@ public class RepairController extends BaseController {
@ApiOperation(value = "导出在修工程维修列表")
@PostMapping("/exportRepairProjectList")
public void exportRepairProjectList(HttpServletResponse response, RepairProjectInfo bean) {
Long deptId = typeService.getUserDeptId();
bean.setCompanyId(deptId);
List<RepairProjectInfo> list = service.getRepairProjectList(bean);
ExcelUtil<RepairProjectInfo> util = new ExcelUtil<RepairProjectInfo>(RepairProjectInfo.class);
util.exportExcel(response, list, "在修工程维修列表");
@ -471,6 +526,8 @@ public class RepairController extends BaseController {
@GetMapping("/getPartUsingList")
public TableDataInfo getPartUsingList(PartDetails bean) {
startPage();
Long deptId = typeService.getUserDeptId();
bean.setCompanyId(deptId);
List<PartDetails> list = service.getPartUsingList(bean);
return getDataTable(list);
}
@ -483,6 +540,8 @@ public class RepairController extends BaseController {
@ApiOperation(value = "导出配件查询列表")
@PostMapping("/exportPartUsingList")
public void exportPartUsingList(HttpServletResponse response, PartDetails bean) {
Long deptId = typeService.getUserDeptId();
bean.setCompanyId(deptId);
List<PartDetails> list = service.getPartUsingList(bean);
ExcelUtil<PartDetails> util = new ExcelUtil<PartDetails>(PartDetails.class);
util.exportExcel(response, list, "配件查询列表");
@ -501,6 +560,8 @@ public class RepairController extends BaseController {
public AjaxResult getRepairQueryList(RepairTask bean) {
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
Long deptId = typeService.getUserDeptId();
bean.setCompanyId(deptId);
List<RepairTask> list = service.getRepairQueryList(bean);
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
}
@ -511,6 +572,8 @@ public class RepairController extends BaseController {
List<RepairTask> list = new ArrayList<>();
List<RepairDetailsExport> listExport = new ArrayList<>();
try {
Long deptId = typeService.getUserDeptId();
bean.setCompanyId(deptId);
list = service.getRepairQueryList(bean);
//将list复制到exportList
for (RepairTask repairTask : list) {
@ -537,6 +600,8 @@ public class RepairController extends BaseController {
public AjaxResult getRepairAuditQueryList(RepairTask bean) {
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
Long deptId = typeService.getUserDeptId();
bean.setCompanyId(deptId);
List<RepairTask> list = service.getRepairAuditQueryList(bean);
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
}
@ -547,6 +612,7 @@ public class RepairController extends BaseController {
@PostMapping("/exportAuditDetails")
@SysLog(title = "导出修试审核任务详情列表", businessType = OperaType.EXPORT, module = "机具系统->导出修试审核任务详情列表")
public void exportAuditDetails(HttpServletResponse response, RepairAuditDetails bean) {
Long deptId = typeService.getUserDeptId();
if (Objects.isNull(bean)) {
bean = new RepairAuditDetails();
}
@ -561,6 +627,7 @@ public class RepairController extends BaseController {
repairTask.setStartTime(bean.getStartTime());
repairTask.setEndTime(bean.getEndTime());
repairTask.setKeyWord(bean.getKeyWord());
repairTask.setCompanyId(deptId);
List<RepairTask> list = service.getRepairAuditQueryList(repairTask);
for (RepairTask repairTask1 : list){
RepairAuditDetailsExport repairAuditDetailsExport = new RepairAuditDetailsExport();

View File

@ -1,9 +1,11 @@
package com.bonus.material.repair.controller;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import com.bonus.common.log.enums.OperaType;
import com.bonus.material.common.annotation.PreventRepeatSubmit;
import com.bonus.material.ma.service.ITypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
@ -37,6 +39,9 @@ public class RepairCostController extends BaseController {
@Autowired
private IRepairCostService repairCostService;
@Resource
private ITypeService typeService;
/**
* 查询维修详细列表
*/
@ -45,6 +50,8 @@ public class RepairCostController extends BaseController {
@GetMapping("/list")
public TableDataInfo list(RepairCost repairCost) {
startPage();
Long deptId = typeService.getUserDeptId();
repairCost.setCompanyId(deptId);
List<RepairCost> list = repairCostService.selectRepairCostList(repairCost);
return getDataTable(list);
}
@ -58,6 +65,8 @@ public class RepairCostController extends BaseController {
@SysLog(title = "维修详细", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出维修详细")
@PostMapping("/export")
public void export(HttpServletResponse response, RepairCost repairCost) {
Long deptId = typeService.getUserDeptId();
repairCost.setCompanyId(deptId);
List<RepairCost> list = repairCostService.selectRepairCostList(repairCost);
ExcelUtil<RepairCost> util = new ExcelUtil<RepairCost>(RepairCost.class);
util.exportExcel(response, list, "维修详细数据");
@ -83,6 +92,8 @@ public class RepairCostController extends BaseController {
@PostMapping
public AjaxResult add(@RequestBody RepairCost repairCost) {
try {
Long deptId = typeService.getUserDeptId();
repairCost.setCompanyId(deptId);
return toAjax(repairCostService.insertRepairCost(repairCost));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());

View File

@ -1,6 +1,7 @@
package com.bonus.material.repair.controller;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.convert.Convert;
@ -13,6 +14,7 @@ import com.bonus.common.log.enums.OperaType;
import com.bonus.material.back.domain.vo.MaCodeVo;
import com.bonus.material.basic.domain.BmQrcodeInfo;
import com.bonus.material.common.annotation.PreventRepeatSubmit;
import com.bonus.material.ma.service.ITypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
@ -45,6 +47,9 @@ public class RepairInputDetailsController extends BaseController {
@Autowired
private IRepairInputDetailsService repairInputDetailsService;
@Resource
private ITypeService typeService;
/**
* 查询修试后入库列表
*/
@ -54,6 +59,8 @@ public class RepairInputDetailsController extends BaseController {
public AjaxResult list(RepairInputDetails repairInputDetails) {
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
Long deptId = typeService.getUserDeptId();
repairInputDetails.setCompanyId(deptId);
List<RepairInputDetails> list = repairInputDetailsService.selectRepairInputDetailsList(repairInputDetails);
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
}
@ -65,6 +72,8 @@ public class RepairInputDetailsController extends BaseController {
if (repairInputDetails.getStartTime() != null && repairInputDetails.getEndTime() != null) {
fileName = "修试后入库列表"+ "(时间" +repairInputDetails.getStartTime() + "" + repairInputDetails.getEndTime()+ "";
}
Long deptId = typeService.getUserDeptId();
repairInputDetails.setCompanyId(deptId);
List<RepairInputDetails> list = repairInputDetailsService.selectRepairInputDetailsList(repairInputDetails);
// 根据list集合数去填充序号
for (int i = 0; i < list.size(); i++) {
@ -88,6 +97,8 @@ public class RepairInputDetailsController extends BaseController {
if (repairInputDetails.getStartTime() != null && repairInputDetails.getEndTime() != null) {
fileName = "修试后入库明细"+ "(时间" +repairInputDetails.getStartTime() + "" + repairInputDetails.getEndTime()+ "";
}
Long deptId = typeService.getUserDeptId();
repairInputDetails.setCompanyId(deptId);
List<RepairInputExportDetails> list = repairInputDetailsService.selectExportDetails(repairInputDetails);
// 根据list集合数去填充序号
for (int i = 0; i < list.size(); i++) {
@ -106,6 +117,8 @@ public class RepairInputDetailsController extends BaseController {
//@RequiresPermissions("repair:details:query")
@GetMapping(value = "/getById")
public AjaxResult getInfo(RepairInputDetails repairInputDetails) {
Long deptId = typeService.getUserDeptId();
repairInputDetails.setCompanyId(deptId);
return success(repairInputDetailsService.selectRepairInputDetailsById(repairInputDetails));
}
@ -119,6 +132,8 @@ public class RepairInputDetailsController extends BaseController {
@PostMapping
public AjaxResult add(@RequestBody RepairInputDetails repairInputDetails) {
try {
Long deptId = typeService.getUserDeptId();
repairInputDetails.setCompanyId(deptId);
return toAjax(repairInputDetailsService.insertRepairInputDetails(repairInputDetails));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());
@ -164,6 +179,8 @@ public class RepairInputDetailsController extends BaseController {
@StoreLog(title = "修试后入库", module = "修试入库->修试后入库")
@PostMapping("/warehouse")
public AjaxResult warehouse(@RequestBody RepairInputDetails repairInputDetails) {
Long deptId = typeService.getUserDeptId();
repairInputDetails.setCompanyId(deptId);
return repairInputDetailsService.warehouse(repairInputDetails);
}
@ -174,6 +191,8 @@ public class RepairInputDetailsController extends BaseController {
*/
@GetMapping("/getInfoByQrcode")
public AjaxResult getInfoByQrcode(BmQrcodeInfo bmQrcodeInfo) {
Long deptId = typeService.getUserDeptId();
bmQrcodeInfo.setCompanyId(deptId);
return repairInputDetailsService.getInfoByQrcode(bmQrcodeInfo);
}
@ -186,6 +205,8 @@ public class RepairInputDetailsController extends BaseController {
// @RequiresPermissions("purchase:storage:add")
@GetMapping("/getCodeList")
public AjaxResult getCodeList(MaCodeVo mdCodeVo) {
Long deptId = typeService.getUserDeptId();
mdCodeVo.setCompanyId(deptId);
return repairInputDetailsService.getCodeList(mdCodeVo);
}
@ -199,6 +220,8 @@ public class RepairInputDetailsController extends BaseController {
// @RequiresPermissions("purchase:storage:reject")
@PostMapping("/reject")
public AjaxResult reject(@RequestBody RepairInputDetails repairInputDetails) {
Long deptId = typeService.getUserDeptId();
repairInputDetails.setCompanyId(deptId);
return repairInputDetailsService.reject(repairInputDetails);
}

View File

@ -1,9 +1,11 @@
package com.bonus.material.repair.controller;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import com.bonus.common.log.enums.OperaType;
import com.bonus.material.common.annotation.PreventRepeatSubmit;
import com.bonus.material.ma.service.ITypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
@ -37,6 +39,9 @@ public class RepairPartDetailsController extends BaseController {
@Autowired
private IRepairPartDetailsService repairPartDetailsService;
@Resource
private ITypeService typeService;
/**
* 查询维修配件详细列表
*/
@ -45,6 +50,8 @@ public class RepairPartDetailsController extends BaseController {
@GetMapping("/list")
public TableDataInfo list(RepairPartDetails repairPartDetails) {
startPage();
Long deptId = typeService.getUserDeptId();
repairPartDetails.setCompanyId(deptId);
List<RepairPartDetails> list = repairPartDetailsService.selectRepairPartDetailsList(repairPartDetails);
return getDataTable(list);
}
@ -58,6 +65,8 @@ public class RepairPartDetailsController extends BaseController {
@SysLog(title = "维修配件详细", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出维修配件详细")
@PostMapping("/export")
public void export(HttpServletResponse response, RepairPartDetails repairPartDetails) {
Long deptId = typeService.getUserDeptId();
repairPartDetails.setCompanyId(deptId);
List<RepairPartDetails> list = repairPartDetailsService.selectRepairPartDetailsList(repairPartDetails);
ExcelUtil<RepairPartDetails> util = new ExcelUtil<RepairPartDetails>(RepairPartDetails.class);
util.exportExcel(response, list, "维修配件详细数据");
@ -83,6 +92,8 @@ public class RepairPartDetailsController extends BaseController {
@PostMapping
public AjaxResult add(@RequestBody RepairPartDetails repairPartDetails) {
try {
Long deptId = typeService.getUserDeptId();
repairPartDetails.setCompanyId(deptId);
return toAjax(repairPartDetailsService.insertRepairPartDetails(repairPartDetails));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());

View File

@ -138,4 +138,7 @@ public class PartDetails extends BaseEntity {
@ApiModelProperty(value="结束时间")
private String endTime;
@ApiModelProperty(value = "组织id")
private Long companyId;
}

View File

@ -152,6 +152,9 @@ public class RepairDeviceVO {
@ApiModelProperty(value = "退料工程名称")
private String backPro;
@ApiModelProperty(value = "组织id")
private Long companyId;
// 手动覆盖 getter 方法确保 List 始终被初始化
public List<RepairPartDetails> getCodeInRepairPartList() {
if (this.codeInRepairPartList == null) {this.codeInRepairPartList = new ArrayList<>();}

View File

@ -91,4 +91,7 @@ public class RepairHomeInfo {
@ApiModelProperty(value = "关键字")
private String keyWord;
@ApiModelProperty(value = "组织id")
private Long companyId;
}

View File

@ -127,4 +127,7 @@ public class RepairInputDetailsVo {
private Integer num;
@ApiModelProperty(value = "组织id")
private Long companyId;
}

View File

@ -142,4 +142,7 @@ public class RepairInspection implements Serializable {
private String keyWord;
@ApiModelProperty(value = "组织id")
private Long companyId;
}

View File

@ -51,4 +51,7 @@ public class RepairPartInfo {
private int partId;
private Integer dsNum;
@ApiModelProperty(value = "组织id")
private Long companyId;
}

View File

@ -91,4 +91,7 @@ public class RepairPartVo {
private Long taskId;
private Long maId;
@ApiModelProperty(value = "组织id")
private Long companyId;
}

View File

@ -88,4 +88,7 @@ public class RepairProjectInfo extends BaseEntity {
@ApiModelProperty(value = "关键字")
private String keyWord;
@ApiModelProperty(value = "组织id")
private Long companyId;
}

View File

@ -143,4 +143,7 @@ public class TestRecord implements Serializable {
private String keyWord;
@ApiModelProperty(value = "组织id")
private Long companyId;
}

View File

@ -136,7 +136,7 @@ public interface RepairMapper {
/**
* 查询维修人员列表
*/
List<SysUser> selectUserList();
List<SysUser> selectUserList(SysUser bean);
/**
* 修改维修任务状态

View File

@ -62,8 +62,10 @@ public interface RepairService {
/**
* 查询维修人员列表
* @param user
* @return
*/
List<SysUser> selectUserList();
List<SysUser> selectUserList(SysUser user);
/**
* 提交审核

View File

@ -11,6 +11,7 @@ import com.bonus.common.core.utils.DateUtils;
import com.bonus.common.core.utils.StringUtils;
import com.bonus.common.security.utils.SecurityUtils;
import com.bonus.material.back.mapper.BackApplyInfoMapper;
import com.bonus.material.ma.service.ITypeService;
import com.bonus.material.repair.domain.*;
import com.bonus.material.repair.domain.vo.RepairAuditDetailsVO;
import com.bonus.material.repair.domain.vo.RepairHomeInfo;
@ -82,6 +83,9 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
@Resource
private BackApplyInfoMapper backApplyInfoMapper;
@Resource
private ITypeService typeService;
@Override
public List<RepairPart> getPartRecord(RepairAuditDetails repairAuditDetails) {
RepairAuditDetails bean = repairAuditDetailsMapper.getRepairId(repairAuditDetails);
@ -226,6 +230,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
@Override
@Transactional(rollbackFor = Exception.class)
public int auditRepair(@NotNull ScrapAudit scrapAudit) throws Exception {
Long deptId = typeService.getUserDeptId();
String checkResult = scrapAudit.getCheckResult();
List<RepairAuditDetails> auditDetailList = scrapAudit.getAuditDetailList();
List<Long> taskIdList = scrapAudit.getTaskIdList();
@ -244,7 +249,6 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
String taskCode;
int taskStatus;
int taskType;
int companyId = 0;
if ("通过".equals(checkResult)) {
status = 1;
List<RepairAuditDetails> repairInputList = new ArrayList<>();
@ -265,14 +269,10 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
}
if (CollectionUtil.isNotEmpty(repairInputList)) {
if (repairInputList.get(0).getCompanyId() != null) {
companyId = repairInputList.get(0).getCompanyId();
}
taskCode = purchaseCodeRule("R", 5);
taskStatus = 53;
taskType = 50;
long inputTaskId = genTask(taskCode, taskType, taskStatus, tmTaskAgreement, companyId);
long inputTaskId = genTask(taskCode, taskType, taskStatus, tmTaskAgreement, deptId);
for (RepairAuditDetails inputDetails : repairInputList) {
Long typeId = inputDetails.getTypeId();
Long maId = inputDetails.getMaId();
@ -290,7 +290,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
repairInputDetails.setStatus("0");
repairInputDetails.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
repairInputDetails.setCreateTime(new Date());
repairInputDetails.setCompanyId((long) companyId);
repairInputDetails.setCompanyId(deptId);
repairInputDetailsMapper.insertRepairInputDetails(repairInputDetails);
}
repairAuditDetailsMapper.updateRepairCost(inputDetails,status);
@ -303,12 +303,9 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
}
}
if (CollectionUtil.isNotEmpty(scrapNumList)) {
if (null != scrapNumList.get(0).getCompanyId()) {
companyId = scrapNumList.get(0).getCompanyId();
}
taskCode = purchaseCodeRule(SCRAP_TASK_TYPE_LABEL, TmTaskTypeEnum.TM_TASK_SCRAP.getTaskTypeId());
//创建报废任务
long scrapTaskId = genTask(taskCode, TmTaskTypeEnum.TM_TASK_SCRAP.getTaskTypeId(), RepairTaskStatusEnum.SCRAP_UNDER_REVIEW.getStatus(), tmTaskAgreement, companyId);
long scrapTaskId = genTask(taskCode, TmTaskTypeEnum.TM_TASK_SCRAP.getTaskTypeId(), RepairTaskStatusEnum.SCRAP_UNDER_REVIEW.getStatus(), tmTaskAgreement, deptId);
for (RepairAuditDetails scrapDetails : scrapNumList) {
RepairAuditDetails byRepairId = scrapApplyDetailsMapper.getByRepairId(String.valueOf(scrapDetails.getRepairId()));
List<RepairRecord> repairRecord = scrapApplyDetailsMapper.getGyoupRepairRecord(byRepairId);
@ -329,7 +326,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
scrapApplyDetails.setParentId(scrapDetails.getId());
scrapApplyDetails.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
scrapApplyDetails.setCreateTime(new Date());
scrapApplyDetails.setCompanyId((long) companyId);
scrapApplyDetails.setCompanyId(deptId);
scrapApplyDetailsMapper.insertScrapApplyDetails(scrapApplyDetails);
}
}
@ -358,13 +355,10 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
repairDetailList.addAll(auditAllList);
}
if (CollectionUtil.isNotEmpty(repairDetailList)) {
if (null != repairDetailList.get(0).getCompanyId()) {
companyId = repairDetailList.get(0).getCompanyId();
}
taskCode = purchaseCodeRule(MaterialConstants.REPAIR_TASK_TYPE_LABEL, 4);
taskStatus = 43;
taskType = 4;
long inputTaskId = genTask(taskCode, taskType, taskStatus, tmTaskAgreement, companyId);
long inputTaskId = genTask(taskCode, taskType, taskStatus, tmTaskAgreement, deptId);
for (RepairAuditDetails inputDetails : repairDetailList) {
Long backId = repairAuditDetailsMapper.getBackId(inputDetails.getRepairId());
/* 添加驳回后维修详细表数据*/
@ -376,7 +370,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
repairTaskDetails.setRepairNum(repairNum);
repairTaskDetails.setStatus("0");
repairTaskDetails.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
repairTaskDetails.setCompanyId((long) companyId);
repairTaskDetails.setCompanyId(deptId);
repairTaskDetails.setBackId(backId);
repairAuditDetailsMapper.insertRepairDetails(repairTaskDetails);
repairAuditDetailsMapper.updateRepairCost(inputDetails,status);
@ -438,12 +432,12 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
/**
* 生成任务并返回任务id
*/
private long genTask(String taskCode, int taskType, int taskStatus, @NotNull TmTaskAgreement tmTaskAgreement, int companyId) {
private long genTask(String taskCode, int taskType, int taskStatus, @NotNull TmTaskAgreement tmTaskAgreement, Long companyId) {
TmTask task = new TmTask();
task.setCode(taskCode);
task.setTaskStatus(taskStatus);
task.setTaskType(taskType);
task.setCompanyId((long) companyId);
task.setCompanyId(companyId);
task.setCreateTime(new Date());
task.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
taskMapper.insertTmTask(task);
@ -457,6 +451,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
taskAgreement.setAgreementId(tmTaskAgreement.getAgreementId());
}
taskAgreement.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
taskAgreement.setCompanyId(companyId);
agreementMapper.insertTmTaskAgreement(taskAgreement);
return taskId;
}
@ -772,6 +767,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
* @param agreementId 协议ID
*/
private void batchInsertRepairInputDetails(List<ScrapApplyDetails> scrapApplyDetailList, List<RepairAuditDetails> repairAuditDetailsByQuery, Long agreementId) {
Long deptId = typeService.getUserDeptId();
boolean inputFlag = false;
boolean scrapFlag = false;
for (RepairAuditDetails repairAuditDetails : repairAuditDetailsByQuery) {
@ -829,6 +825,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
return false;
}).collect(Collectors.toList());
} else {
dto.setCompanyId(Math.toIntExact(deptId));
list = scrapApplyDetailsMapper.selectScrapByTaskId(dto);
}
@ -845,6 +842,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
inputVo.setStatus("0");
inputVo.setTaskId(newTaskId);
inputVo.setCreateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
inputVo.setCompanyId(deptId);
inputList.add(inputVo);
}
if (details.getScrapNum().compareTo(BigDecimal.ZERO) > 0) {
@ -870,6 +868,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
scrapApplyDetails.setScrapReason(info.getScrapReason() == null ? "" : info.getScrapReason());
scrapApplyDetails.setScrapType(info.getScrapType() == null ? null : info.getScrapType());
scrapApplyDetails.setCreateBy(info.getCreateBy() == null ? SecurityUtils.getLoginUser().getSysUser().getNickName() : info.getCreateBy());
scrapApplyDetails.setCompanyId(deptId);
scrapApplyDetailsMapper.insertScrapApplyDetails(scrapApplyDetails);
}
}
@ -887,9 +886,11 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
* @param agreementId
*/
private void insertScrapTta(Long newScrapTaskId, Long agreementId) {
Long deptId = typeService.getUserDeptId();
final TmTaskAgreement tmTaskAgreement = new TmTaskAgreement(newScrapTaskId, agreementId);
tmTaskAgreement.setCreateTime(DateUtils.getNowDate());
tmTaskAgreement.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
tmTaskAgreement.setCompanyId(deptId);
taskAgreementMapper.insertTmTaskAgreement(tmTaskAgreement);
}
@ -898,6 +899,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
* @return
*/
private Long insertScrapTt() {
Long deptId = typeService.getUserDeptId();
Long newTask = null;
int thisMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_SCRAP.getTaskTypeId());
// 生成报废单号
@ -912,6 +914,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
tmTask.setCreateTime(DateUtils.getNowDate());
tmTask.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
// 插入任务
tmTask.setCompanyId(deptId);
int taskId = taskMapper.insertTmTask(tmTask);
// 如果插入成功且返回的 taskId 大于 0
if (taskId > 0 && tmTask.getTaskId() > 0) {
@ -939,9 +942,11 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
* @param agreementId
*/
private void insertTta(Long newTaskId, Long agreementId) {
Long deptId = typeService.getUserDeptId();
final TmTaskAgreement tmTaskAgreement = new TmTaskAgreement(newTaskId, agreementId);
tmTaskAgreement.setCreateTime(DateUtils.getNowDate());
tmTaskAgreement.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
tmTaskAgreement.setCompanyId(deptId);
taskAgreementMapper.insertTmTaskAgreement(tmTaskAgreement);
}
@ -950,6 +955,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
* @return
*/
private Long insertTt() {
Long deptId = typeService.getUserDeptId();
Long newTask = null;
int thisMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_REPAIR_INPUT.getTaskTypeId());
// 生成修饰入库单号
@ -964,6 +970,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
throw new RuntimeException("该审核任务正在进行中,请勿重复提交!");
}
// 插入任务
tmTask.setCompanyId(deptId);
int taskId = taskMapper.insertTmTask(tmTask);
// 如果插入成功且返回的 taskId 大于 0
if (taskId > 0 && tmTask.getTaskId() > 0) {

View File

@ -384,9 +384,11 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
*/
private int processRepairRejectTask(RePairDto rePairDto) {
int result = 0;
Long deptId = typeService.getUserDeptId();
RepairInputDetails repairInputDetails1 = new RepairInputDetails();
repairInputDetails1.setTaskId(rePairDto.getTaskId());
repairInputDetails1.setAgreementId(rePairDto.getAgreementId());
repairInputDetails1.setCompanyId(deptId);
List<RepairInputInfo> list = repairInputDetailsMapper.selectRepairDetailsById(repairInputDetails1);
//根据任务id查询退料id
Long backId = repairInputDetailsMapper.selectBackIdByTaskId(rePairDto.getTaskId());
@ -539,7 +541,9 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
* @return
*/
private int insertWxTask(Long newTaskId, RepairInputDetails repairInputDetails) {
Long deptId = typeService.getUserDeptId();
repairInputDetails.setTaskId(newTaskId);
repairInputDetails.setCompanyId(deptId);
return repairInputDetailsMapper.insertRad(repairInputDetails);
}
@ -551,10 +555,12 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
*/
private int insertTta(Long newTaskId, RepairInputDetails repairInputDetails) {
int res;
Long deptId = typeService.getUserDeptId();
String agreementId = String.valueOf(repairInputDetails.getAgreementId());
TmTaskAgreement tmTaskAgreement = new TmTaskAgreement(newTaskId, Long.parseLong(agreementId));
tmTaskAgreement.setCreateTime(DateUtils.getNowDate());
tmTaskAgreement.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
tmTaskAgreement.setCompanyId(deptId);
res = taskAgreementMapper.insertTmTaskAgreement(tmTaskAgreement);
return res;
}
@ -564,6 +570,7 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
* @return
*/
private Long insertTt(Long preTaskId) {
Long deptId = typeService.getUserDeptId();
Long newTask = null;
int thisMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_REPAIR.getTaskTypeId());
// 生成维修单号
@ -574,6 +581,7 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
tmTask.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
tmTask.setPreTaskId(preTaskId);
// 插入任务
tmTask.setCompanyId(deptId);
int taskId = taskMapper.insertTmTask(tmTask);
// 如果插入成功且返回的 taskId 大于 0
if (taskId > 0 && tmTask.getTaskId() > 0) {

View File

@ -18,6 +18,7 @@ import com.bonus.material.basic.mapper.BmFileInfoMapper;
import com.bonus.material.ma.domain.PartType;
import com.bonus.material.ma.mapper.MachineMapper;
import com.bonus.material.ma.mapper.PartTypeMapper;
import com.bonus.material.ma.service.ITypeService;
import com.bonus.material.repair.domain.*;
import com.bonus.material.repair.domain.vo.*;
import com.bonus.material.repair.mapper.*;
@ -95,6 +96,9 @@ public class RepairServiceImpl implements RepairService {
@Resource
private RepairPartDetailsMapper repairPartDetailsMapper;
@Resource
private ITypeService typeService;
// 1:内部维修 2:外部返厂维修 3:报废
private final int INNER_REPAIR = 1; // 需要严格匹配枚举值 RepairTypeEnum.INNER_REPAIR.getTypeId();
private final int RETURN_FACTORY = 2; // 需要严格匹配枚举值 RepairTypeEnum.RETURN_FACTORY.getTypeId();
@ -521,7 +525,7 @@ public class RepairServiceImpl implements RepairService {
@Transactional(rollbackFor = Exception.class)
public AjaxResult fastRepairApply(List<RepairTaskDetails> list) {
LoginUser loginUser = SecurityUtils.getLoginUser();
Long deptId = typeService.getUserDeptId();
// 判断待维修数量是否大于0
for (RepairTaskDetails bean : list) {
BigDecimal repairedNum = bean.getRepairNum().subtract(bean.getRepairedNum()).subtract(bean.getScrapNum());
@ -532,6 +536,7 @@ public class RepairServiceImpl implements RepairService {
// 执行SQL 1.增加维修记录表 2.修改维修明细表的维修数量
for (RepairTaskDetails bean : list) {
bean.setCompanyId(deptId);
BigDecimal repairedNum = bean.getRepairNum().subtract(bean.getRepairedNum()).subtract(bean.getScrapNum());
RepairApplyRecord repairRecord = new RepairApplyRecord();
repairRecord.setTaskId(bean.getTaskId());
@ -561,9 +566,11 @@ public class RepairServiceImpl implements RepairService {
*/
private int insertTta(Long newTaskId, Long agreementId) {
int res;
Long deptId = typeService.getUserDeptId();
TmTaskAgreement tmTaskAgreement = new TmTaskAgreement(newTaskId, agreementId);
tmTaskAgreement.setCreateTime(DateUtils.getNowDate());
tmTaskAgreement.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
tmTaskAgreement.setCompanyId(deptId);
res = taskAgreementMapper.insertTmTaskAgreement(tmTaskAgreement);
return res;
}
@ -572,6 +579,7 @@ public class RepairServiceImpl implements RepairService {
* 生成任务表
*/
private Long insertTt(String createBy) {
Long deptId = typeService.getUserDeptId();
Long newTask = null;
int thisMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_REPAIR.getTaskTypeId());
// 生成维修单号
@ -580,6 +588,7 @@ public class RepairServiceImpl implements RepairService {
null, thisMonthMaxOrder + 1, code);
tmTask.setCreateTime(DateUtils.getNowDate());
tmTask.setCreateBy(createBy);
tmTask.setCompanyId(deptId);
// 插入任务
int taskId = taskMapper.insertTmTask(tmTask);
// 如果插入成功且返回的 taskId 大于 0
@ -593,6 +602,7 @@ public class RepairServiceImpl implements RepairService {
@Transactional(rollbackFor = Exception.class)
public AjaxResult endRepairTask(@NotNull List<RepairTask> taskList) {
LoginUser loginUser = SecurityUtils.getLoginUser();
Long deptId = typeService.getUserDeptId();
// 修试审核标志
boolean isWSFlag = false;
try {
@ -621,6 +631,7 @@ public class RepairServiceImpl implements RepairService {
// 3.业务逻辑处理
for (RepairTask task : taskList) {
task.setCompanyId(deptId);
Long agreementId = null;
// 查询维修任务的详情表
Long oldWxTaskId = task.getTaskId();
@ -652,6 +663,7 @@ public class RepairServiceImpl implements RepairService {
}
// 新增审计记录
for (RepairTaskDetails details : detailsList) {
details.setCompanyId(deptId);
if (StringUtils.isNotBlank(details.getMaId())) {
if ("0".equals(details.getStatus())) {
isWxFlag = true;
@ -714,6 +726,7 @@ public class RepairServiceImpl implements RepairService {
repairTaskDetail.setStatus("0");
repairTaskDetail.setNewTaskId(newTaskId);
repairTaskDetail.setIsDs(0);
repairTaskDetail.setCompanyId(deptId);
repairMapper.insertRepaired(repairTaskDetail);
}
} else {
@ -996,8 +1009,8 @@ public class RepairServiceImpl implements RepairService {
}
@Override
public List<SysUser> selectUserList() {
return repairMapper.selectUserList();
public List<SysUser> selectUserList(SysUser bean) {
return repairMapper.selectUserList(bean);
}
@Override
@ -1391,12 +1404,13 @@ public class RepairServiceImpl implements RepairService {
try {
// 获取当前登录用户提前获取避免多次调用
LoginUser loginUser = SecurityUtils.getLoginUser();
Long deptId = typeService.getUserDeptId();
// 校验并过滤空数据
repairDeviceVOList.removeIf(Objects::isNull);
// 遍历处理每个维修设备信息
for (RepairDeviceVO repairDevice : repairDeviceVOList) {
repairDevice.setCompanyId(deptId);
// 校验物资管理方式是否为空
if (null == repairDevice.getManageType()) {
throw new ServiceException("请选择物资管理方式");
@ -1633,6 +1647,7 @@ public class RepairServiceImpl implements RepairService {
.setStatus(0L)
.setId(repairDevice.getId())
.setPartType(repairDevice.getCodeScrapRepairPartList().get(0).getPartType())
.setCompanyId(repairDevice.getCompanyId())
.setRepairType(3);
return scrapCostsRecord;
}
@ -1879,6 +1894,7 @@ public class RepairServiceImpl implements RepairService {
.setPartNum(partDetails.getPartNum())
.setRepairer(loginUser.getUsername())
.setPartPrice(Optional.ofNullable(partDetails.getPartPrice()).orElse(BigDecimal.ZERO))
.setCompanyId(repairDevice.getCompanyId())
.setCreateBy(loginUser.getSysUser().getNickName());
// 设置备注
@ -2000,6 +2016,8 @@ public class RepairServiceImpl implements RepairService {
.setScrapReason(firstPart.getScrapReason())
.setScrapType(firstPart.getScrapType())
.setRepairer(loginUser.getUsername())
.setCompanyId(repairDevice.getCompanyId())
.setPartType(Integer.valueOf(firstPart.getScrapType()))
.setCreateBy(loginUser.getUsername());
return repairApplyRecord;
}
@ -2062,13 +2080,19 @@ public class RepairServiceImpl implements RepairService {
private void copeNumberManageInListNew(RepairDeviceVO bean, List<RepairPartDetails> partList, LoginUser loginUser, Integer manageType) {
// 过滤无效数据保留partId不为null的数据生成新集合
List<RepairPartDetails> validPartList;
String scrapType = "";
if (bean.getRepairType() != null && bean.getRepairType() != 2) {
if (bean.getRepairType() == 3){
if (partList.size() > 0){
scrapType = partList.get(0).getScrapType();
}
}
validPartList = partList.stream()
.filter(partDetails -> partDetails.getPartId() != null)
.collect(Collectors.toList());
} else {
validPartList = partList.stream()
.filter(partDetails -> partDetails.getPartName() != null && partDetails.getPartPrice() != null && partDetails.getPartNum() != null)
.filter(partDetails -> partDetails.getPartName() != null && partDetails.getPartNum() != null)
.collect(Collectors.toList());
}
@ -2078,7 +2102,7 @@ public class RepairServiceImpl implements RepairService {
partList.addAll(validPartList);
if (CollectionUtil.isEmpty(partList)) {
// 配件为空时添加默认维修记录
addDefaultRepairRecord(bean, loginUser);
addDefaultRepairRecord(bean, loginUser,scrapType);
return;
}
@ -2122,7 +2146,7 @@ public class RepairServiceImpl implements RepairService {
* @param bean 维修申请单
* @param loginUser 当前登录用户
*/
private void addDefaultRepairRecord(RepairDeviceVO bean, LoginUser loginUser) {
private void addDefaultRepairRecord(RepairDeviceVO bean, LoginUser loginUser, String scrapType) {
RepairApplyRecord repairApplyRecord = new RepairApplyRecord();
Integer repairType = bean.getRepairType();
boolean isScrap = RepairTypeEnum.TO_SCRAP.getTypeId().equals(repairType);
@ -2134,7 +2158,11 @@ public class RepairServiceImpl implements RepairService {
.setStatus(0L)
.setRepairNum(BigDecimal.valueOf(isScrap ? 0 : 1))
.setScrapNum(BigDecimal.valueOf(isScrap ? 1 : 0))
.setCompanyId(bean.getCompanyId())
.setCreateBy(loginUser.getUsername());
if (bean.getRepairType() == 3){
repairApplyRecord.setPartType(Integer.valueOf(scrapType));
}
repairMapper.addRecord(repairApplyRecord);
}
@ -2230,7 +2258,7 @@ public class RepairServiceImpl implements RepairService {
partDetails.setTaskId(bean.getTaskId())
.setMaId(bean.getMaId())
.setTypeId(bean.getTypeId())
.setCompanyId(null)
.setCompanyId(bean.getCompanyId())
.setCreateBy(String.valueOf(loginUser.getUserid()));
// 查询配件单价并设置
@ -2246,6 +2274,7 @@ public class RepairServiceImpl implements RepairService {
.setPartNum(partDetails.getPartNum())
.setRepairContent(partDetails.getRepairContent())
.setPartType(partDetails.getPartType())
.setCompanyId(bean.getCompanyId())
.setPartId(Optional.ofNullable(partDetails.getPartId()).orElse(0L));
// 添加维修记录表
@ -2369,6 +2398,7 @@ public class RepairServiceImpl implements RepairService {
.setSupplierId(partDetails.getSupplierId())
.setPartNum(partDetails.getPartNum())
.setPartPrice(Optional.ofNullable(partDetails.getPartPrice()).orElse(BigDecimal.ZERO))
.setCompanyId(bean.getCompanyId())
.setCreateBy(loginUser.getSysUser().getNickName());
// 设置维修/报废数量
@ -2438,6 +2468,8 @@ public class RepairServiceImpl implements RepairService {
.setCreateBy(loginUser.getUsername());
repairApplyRecord.setScrapType(partDetails.getScrapType())
.setScrapReason(partDetails.getScrapReason())
.setCompanyId(bean.getCompanyId())
.setPartType(Integer.valueOf(partDetails.getScrapType()))
.setScrapId(partDetails.getScrapId());
return repairApplyRecord;

View File

@ -81,9 +81,9 @@
</insert>
<insert id="addRepairCost">
insert into repair_cost (task_id, repair_id, type_id, ma_id, repair_num, costs, part_type, status, repair_type,is_ds)
insert into repair_cost (task_id, repair_id, type_id, ma_id, repair_num, costs, part_type, status, repair_type,is_ds,company_id)
values (#{bean.taskId}, #{bean.id}, #{bean.typeId}, #{bean.maId}, #{bean.repairNum}, #{costs}, #{partType}, '0',
#{bean.repairType},1);
#{bean.repairType},1,#{bean.companyId});
</insert>
<insert id="insertRad">
@ -330,6 +330,9 @@
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND tt.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
</if>
<if test="companyId != null">
AND rd.company_id = #{companyId}
</if>
GROUP BY rd.task_id,bui.unit_name,bpi.pro_name,bai.code,su.nick_name
order by tt.create_time desc
</select>

View File

@ -979,6 +979,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="maId != null">ma_id,</if>
create_time,
<if test="createBy != null and createBy != ''">creater,</if>
<if test="companyId != null">company_id,</if>
<if test="style != null and style != ''">style,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@ -994,6 +995,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="maId != null">#{maId},</if>
NOW(),
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="companyId != null">#{companyId},</if>
<if test="style != null and style != ''">#{style},</if>
</trim>
</insert>
@ -1014,6 +1016,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">status,</if>
<if test="createBy != null and createBy != ''">creator,</if>
<if test="resultMsg != null and resultMsg != ''">result_msg,</if>
<if test="companyId != null">company_id,</if>
<if test="inputType != null">input_type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@ -1030,6 +1033,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">#{status},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="resultMsg != null and resultMsg != ''">#{resultMsg},</if>
<if test="companyId != null">#{companyId},</if>
<if test="inputType != null">#{inputType},</if>
</trim>
</insert>

View File

@ -76,6 +76,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="typeName != null and typeName != ''">
AND mt1.type_id = #{typeName}
</if>
<if test="companyId != null">
AND rad.company_id = #{companyId}
</if>
order by rad.create_time desc
</select>
@ -135,6 +138,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="typeId != null and typeId != ''">
and rpd.type_id = #{typeId}
</if>
<if test="companyId != null">
AND rpd.company_id = #{companyId}
</if>
</where>
</select>
@ -228,6 +234,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="typeId != null and typeId != ''">
and rar.type_id = #{typeId}
</if>
<if test="companyId != null">
AND rar.company_id = #{companyId}
</if>
</where>
</select>
@ -388,6 +397,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="appTaskStatus != null and appTaskStatus == 11">
AND (tk.task_status = 11 OR tk.task_status = 12)
</if>
<if test="companyId != null">
AND tk.company_id = #{companyId}
</if>
GROUP BY
tk.CODE
@ -452,6 +464,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="appTaskStatus != null and appTaskStatus == 11">
AND (tk.task_status = 11 OR tk.task_status = 12)
</if>
<if test="companyId != null">
AND tk.company_id = #{companyId}
</if>
GROUP BY
tk.CODE
) AS combined_results
@ -732,6 +747,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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="companyId !=null">
and rad.company_id = #{companyId}
</if>
GROUP BY
rad.type_id,
rad.task_id

View File

@ -65,6 +65,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
rad.create_time
FROM
repair_apply_details rad
WHERE 1=1
<if test="companyId !=null">
AND rad.company_id = #{companyId}
</if>
GROUP BY rad.task_id
) rad ON rad.task_id = rd.repair_id
LEFT JOIN back_apply_info bai ON rad.back_id = bai.id
@ -87,6 +91,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
<![CDATA[and DATE_FORMAT( rd.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
</if>
<if test="companyId !=null">
AND rd.company_id = #{companyId}
</if>
</where>
GROUP BY rd.task_id
@ -142,6 +149,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
<![CDATA[and DATE_FORMAT( rd.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
</if>
<if test="companyId !=null">
AND rd.company_id = #{companyId}
</if>
</where>
GROUP BY rd.task_id
) AS combined_results
@ -196,6 +206,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
or locate(#{keyWord}, mt.unit_name) > 0
)
</if>
<if test="companyId !=null">
AND rid.company_id = #{companyId}
</if>
GROUP BY rid.type_id
</select>
@ -237,6 +250,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
or locate(#{keyWord}, mm.ma_code) > 0
)
</if>
<if test="companyId !=null">
AND rid.company_id = #{companyId}
</if>
</select>
<select id="selectRepairDetailsById" resultType="com.bonus.material.repair.domain.RepairInputInfo">
@ -269,6 +285,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="typeId != null">
and rd.type_id = #{typeId}
</if>
<if test="companyId !=null">
AND rd.company_id = #{companyId}
</if>
</select>
<select id="selectBackIdByTaskId" resultType="java.lang.Long">
@ -351,6 +370,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="maCode != null and maCode != ''">
and mm.ma_code like concat('%',#{maCode},'%')
</if>
<if test="companyId != null">
and mm.company_id = #{companyId}
</if>
</select>
<insert id="batchInsertRepairInputDetails" parameterType="com.bonus.common.biz.domain.repair.RepairInputDetails">
@ -643,6 +665,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
rad.create_time
FROM
repair_apply_details rad
where 1=1
<if test="companyId !=null">
AND rad.company_id = #{companyId}
</if>
GROUP BY rad.task_id
) rad ON rad.task_id = rd.repair_id
LEFT JOIN back_apply_info bai ON rad.back_id = bai.id
@ -673,6 +699,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="taskStatus != null">
and rd.status = #{taskStatus}
</if>
<if test="companyId !=null">
AND rd.company_id = #{companyId}
</if>
</where>
GROUP BY rd.task_id,
rd.type_id,
@ -735,6 +764,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="taskStatus != null">
and rd.status = #{taskStatus}
</if>
<if test="companyId !=null">
AND rd.company_id = #{companyId}
</if>
</where>
GROUP BY rd.task_id,
rd.type_id,

View File

@ -29,8 +29,8 @@
</insert>
<insert id="addRepairCost">
insert into repair_cost (task_id,repair_id,type_id,ma_id,repair_num,costs,part_type,status,repair_type)
values (#{bean.taskId},#{bean.id},#{bean.typeId},#{bean.maId},#{bean.repairNum},#{costs},#{partType},'0',#{bean.repairType});
insert into repair_cost (task_id,repair_id,type_id,ma_id,repair_num,costs,part_type,status,repair_type,company_id)
values (#{bean.taskId},#{bean.id},#{bean.typeId},#{bean.maId},#{bean.repairNum},#{costs},#{partType},'0',#{bean.repairType},#{bean.companyId});
</insert>
<insert id="insertRepaired">
@ -75,6 +75,9 @@
<if test="isDs != null">
is_ds,
</if>
<if test="companyId != null">
company_id,
</if>
create_time
)
values (
@ -117,6 +120,9 @@
<if test="isDs != null">
#{isDs},
</if>
<if test="companyId != null">
#{companyId},
</if>
NOW()
)
</insert>
@ -342,6 +348,9 @@
<if test="appTaskStatus != null and appTaskStatus == 1">
and (tt.task_status = 1 or tt.task_status = 2)
</if>
<if test="companyId != null">
and rd.company_id = #{companyId}
</if>
and is_ds=0
</where>
GROUP BY rd.task_id,bui.unit_name,bpi.pro_name,bai.code,su.nick_name
@ -455,7 +464,7 @@
where
rad.task_id = #{taskId}
and rad.is_ds=0
<if test="companyId != null and companyId != ''">
<if test="companyId != null">
and rad.company_id = #{companyId}
</if>
<if test="keyword != null and keyword != ''">
@ -540,6 +549,9 @@
LEFT JOIN sys_user_role sur on su.user_id = sur.user_id
LEFT JOIN sys_role sr on sur.role_id = sr.role_id
WHERE sr.role_key = 'wx'
<if test="companyId != null">
and su.company_id = #{companyId}
</if>
</select>
<select id="getAgreementId" resultType="java.lang.Long">
@ -611,6 +623,9 @@
INSTR(b.wxName,#{keyWord}) > 0
)
</if>
<if test="companyId!=null">
AND rid.company_id = #{companyId}
</if>
</where>
</select>
@ -651,6 +666,9 @@
<if test="typeId!=null and typeId!=''">
AND a.typeId = #{typeId}
</if>
<if test="companyId!=null">
AND rid.company_id = #{companyId}
</if>
ORDER BY rid.create_time DESC
</select>
@ -693,6 +711,9 @@
AND a.type_id = rar.type_id
WHERE
rar.task_id = #{taskId} and rar.type_id = #{typeId}
<if test="companyId!=null">
and rar.company_id = #{companyId}
</if>
</select>
<select id="getAuditDetailsById" resultType="com.bonus.material.repair.domain.RepairTaskDetails">
@ -795,6 +816,9 @@
<if test="proId != null">
and bp.pro_id = #{proId}
</if>
<if test="companyId!=null">
AND rad.company_id = #{companyId}
</if>
ORDER BY rad.update_time DESC
</select>
@ -826,6 +850,9 @@
<if test="maId != null">
AND rar.ma_id = #{maId}
</if>
<if test="companyId!=null">
AND rar.company_id = #{companyId}
</if>
</select>
<select id="selectSecondRepairPartList" resultType="com.bonus.material.repair.domain.vo.RepairPartInfo">
@ -878,6 +905,9 @@
<if test="maId != null">
AND rar.ma_id = #{maId}
</if>
<if test="companyId!=null">
AND rar.company_id = #{companyId}
</if>
GROUP BY
rar.part_id,
rar.part_name
@ -992,6 +1022,9 @@
rad.task_id=#{taskId}
and rad.type_id=#{typeId}
and rad.is_ds=0
<if test="companyId != null">
and rad.company_id = #{companyId}
</if>
</select>
<select id="getTestRecordData" resultType="com.bonus.material.repair.domain.RepairTaskDetails">
@ -1017,6 +1050,9 @@
LEFT JOIN sys_user su on su.user_id=rad.repairer
WHERE
rad.id=#{id}
<if test="companyId != null">
and rad.company_id = #{companyId}
</if>
</select>
<select id="getPartData" resultType="com.bonus.material.ma.domain.PartType">
@ -1034,6 +1070,10 @@
and rar.part_id IS NOT NULL
and mpt2.pa_name IS NOT NULL
]]>
<if test="companyId != null">
and rar.company_id = #{companyId}
</if>
</select>
<select id="getRepairedScrapNumById" resultType="java.lang.Integer">
@ -1123,7 +1163,7 @@
rad.task_id = #{taskId}
and rad.type_id=#{typeId}
and rad.is_ds=0
<if test="companyId != null and companyId != ''">
<if test="companyId != null">
and rad.company_id = #{companyId}
</if>
<if test="keyword != null and keyword != ''">
@ -1189,6 +1229,9 @@
and (mt2.type_name like CONCAT('%', #{keyWord}, '%') OR tt.`code` like CONCAT('%', #{keyWord}, '%') OR
mt1.type_name like CONCAT('%', #{keyWord}, '%'))
</if>
<if test="companyId!=null">
AND rad.company_id = #{companyId}
</if>
GROUP BY typeName, typeModelName, repairCode
</select>
<select id="getTestRecord" resultType="com.bonus.material.repair.domain.vo.TestRecord">
@ -1241,6 +1284,9 @@
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>
<if test="companyId!=null">
AND rad.company_id = #{companyId}
</if>
GROUP BY typeName, typeModelName, repairCode,maCode
</select>
<select id="getTestRecordDetails" resultType="com.bonus.material.repair.domain.RepairTaskDetails">
@ -1385,7 +1431,7 @@
rad.scrap_num!=0 or
rad.this_scrap_num!=0
)
<if test="companyId != null and companyId != ''">
<if test="companyId != null">
and rad.company_id = #{companyId}
</if>
<if test="keyword != null and keyword != ''">
@ -1463,6 +1509,9 @@
<if test="keyWord!=null and keyWord!=''">
AND mm.ma_code LIKE CONCAT('%', #{keyWord}, '%')
</if>
<if test="companyId != null">
and rad.company_id = #{companyId}
</if>
GROUP BY rad.task_id, rad.type_id, rad.ma_id
</select>
@ -1507,6 +1556,9 @@
LEFT JOIN bm_unit bu ON bu.unit_id = bai.unit_id
WHERE
tt.task_status IN (0, 4) and tt.code is not null
<if test="companyId != null">
and rad.company_id = #{companyId}
</if>
GROUP BY
mt.type_id,
tt.`code`
@ -1533,6 +1585,9 @@
<if test="impUnitName != null and impUnitName != ''">
and subquery2.impUnitName LIKE CONCAT('%', #{impUnitName}, '%')
</if>
<if test="companyId!=null">
AND mt.company_id = #{companyId}
</if>
GROUP BY mt.type_id,
subquery2.taskCode
</select>
@ -1670,6 +1725,9 @@
<if test="impUnitName != null and impUnitName != ''">
and sd.dept_name LIKE CONCAT('%', #{impUnitName}, '%')
</if>
<if test="companyId!=null">
AND rpd.company_id = #{companyId}
</if>
order by rpd.create_time desc
</select>
<select id="getRepairNumByTaskId" resultType="com.bonus.material.repair.domain.vo.RepairDeviceVO">
@ -1748,6 +1806,9 @@
<if test="appTaskStatus != null and appTaskStatus == 1">
and (tt.task_status = 1 or tt.task_status = 2)
</if>
<if test="companyId != null">
and rad.company_id = #{companyId}
</if>
GROUP BY rad.task_id,rad.type_id
ORDER BY tt.create_time desc
</select>
@ -1788,6 +1849,9 @@
<if test="taskStatus != null and taskStatus != ''">
AND tt.task_status = #{taskStatus}
</if>
<if test="companyId != null">
and rad.company_id = #{companyId}
</if>
GROUP BY rad.task_id, rad.type_id
UNION
@ -1827,6 +1891,9 @@
<if test="taskStatus != null and taskStatus != ''">
AND tt.task_status = #{taskStatus}
</if>
<if test="companyId != null">
and rad.company_id = #{companyId}
</if>
GROUP BY rad.task_id, rad.type_id) a
order by createTime desc
</select>
@ -1880,7 +1947,7 @@
]]>
where
rad.task_id = #{taskId}
<if test="companyId != null and companyId != ''">
<if test="companyId != null">
and rad.company_id = #{companyId}
</if>
<if test="keyword != null and keyword != ''">