工作站删除功能完善

This commit is contained in:
JinLu.Yin 2022-08-24 22:14:35 +08:00
parent f466326bcf
commit 2e5ba5bc25
14 changed files with 107 additions and 3 deletions

View File

@ -5,11 +5,12 @@ import javax.servlet.http.HttpServletResponse;
import com.ktg.common.constant.UserConstants;
import com.ktg.mes.md.domain.MdWorkshop;
import com.ktg.mes.md.service.IMdWorkshopService;
import com.ktg.mes.md.service.*;
import com.ktg.mes.pro.domain.ProProcess;
import com.ktg.mes.pro.service.IProProcessService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
@ -23,7 +24,6 @@ import com.ktg.common.core.controller.BaseController;
import com.ktg.common.core.domain.AjaxResult;
import com.ktg.common.enums.BusinessType;
import com.ktg.mes.md.domain.MdWorkstation;
import com.ktg.mes.md.service.IMdWorkstationService;
import com.ktg.common.utils.poi.ExcelUtil;
import com.ktg.common.core.page.TableDataInfo;
@ -40,6 +40,15 @@ public class MdWorkstationController extends BaseController
@Autowired
private IMdWorkstationService mdWorkstationService;
@Autowired
private IMdWorkstationMachineService mdWorkstationMachineService;
@Autowired
private IMdWorkstationToolService mdWorkstationToolService;
@Autowired
private IMdWorkstationWorkerService mdWorkstationWorkerService;
@Autowired
private IProProcessService proProcessService;
@ -134,9 +143,16 @@ public class MdWorkstationController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('mes:md:workstation:remove')")
@Log(title = "工作站", businessType = BusinessType.DELETE)
@Transactional
@DeleteMapping("/{workstationIds}")
public AjaxResult remove(@PathVariable Long[] workstationIds)
{
for (Long workstationId: workstationIds
) {
mdWorkstationMachineService.deleteByWorkstationId(workstationId);
mdWorkstationToolService.deleteByWorkstationId(workstationId);
mdWorkstationWorkerService.deleteByWorkstationId(workstationId);
}
return toAjax(mdWorkstationService.deleteMdWorkstationByWorkstationIds(workstationIds));
}
}

View File

@ -60,4 +60,11 @@ public interface MdWorkstationMachineMapper
* @return 结果
*/
public int deleteMdWorkstationMachineByRecordIds(Long[] recordIds);
/**
* 根据工作站ID删除对应的设备列表
* @param workstationId
* @return
*/
public int deleteByWorkstationId(Long workstationId);
}

View File

@ -60,4 +60,11 @@ public interface MdWorkstationToolMapper
* @return 结果
*/
public int deleteMdWorkstationToolByRecordIds(Long[] recordIds);
/**
* 根据工作站ID删除对应的工装夹具信息
* @param workstationId
* @return
*/
public int deleteByWorkstationId(Long workstationId);
}

View File

@ -61,4 +61,11 @@ public interface MdWorkstationWorkerMapper
* @return 结果
*/
public int deleteMdWorkstationWorkerByRecordIds(Long[] recordIds);
/**
* 根据工作站ID删除对应的人员信息
* @param workstationId
* @return
*/
public int deleteByWorkstationId(Long workstationId);
}

View File

@ -60,4 +60,11 @@ public interface IMdWorkstationMachineService
* @return 结果
*/
public int deleteMdWorkstationMachineByRecordId(Long recordId);
/**
* 根据工作站ID删除对应的设备列表
* @param workstationId
* @return
*/
public int deleteByWorkstationId(Long workstationId);
}

View File

@ -65,4 +65,11 @@ public interface IMdWorkstationToolService
* @return 结果
*/
public int deleteMdWorkstationToolByRecordId(Long recordId);
/**
* 根据工作站ID删除对应的工装夹具信息
* @param workstationId
* @return
*/
public int deleteByWorkstationId(Long workstationId);
}

View File

@ -65,4 +65,11 @@ public interface IMdWorkstationWorkerService
* @return 结果
*/
public int deleteMdWorkstationWorkerByRecordId(Long recordId);
/**
* 根据工作站ID删除对应的人员信息
* @param workstationId
* @return
*/
public int deleteByWorkstationId(Long workstationId);
}

View File

@ -108,4 +108,9 @@ public class MdWorkstationMachineServiceImpl implements IMdWorkstationMachineSer
{
return mdWorkstationMachineMapper.deleteMdWorkstationMachineByRecordId(recordId);
}
@Override
public int deleteByWorkstationId(Long workstationId) {
return mdWorkstationMachineMapper.deleteByWorkstationId(workstationId);
}
}

View File

@ -106,4 +106,9 @@ public class MdWorkstationToolServiceImpl implements IMdWorkstationToolService
{
return mdWorkstationToolMapper.deleteMdWorkstationToolByRecordId(recordId);
}
@Override
public int deleteByWorkstationId(Long workstationId) {
return mdWorkstationToolMapper.deleteByWorkstationId(workstationId);
}
}

View File

@ -106,4 +106,9 @@ public class MdWorkstationWorkerServiceImpl implements IMdWorkstationWorkerServi
{
return mdWorkstationWorkerMapper.deleteMdWorkstationWorkerByRecordId(recordId);
}
@Override
public int deleteByWorkstationId(Long workstationId) {
return mdWorkstationWorkerMapper.deleteByWorkstationId(workstationId);
}
}

View File

@ -3,10 +3,13 @@ package com.ktg.mes.pro.controller;
import com.ktg.common.constant.UserConstants;
import com.ktg.common.core.controller.BaseController;
import com.ktg.common.core.domain.AjaxResult;
import com.ktg.common.utils.StringUtils;
import com.ktg.mes.pro.domain.ProProcess;
import com.ktg.mes.pro.service.IProProcessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -26,4 +29,20 @@ public class ProProcessMobController extends BaseController {
List<ProProcess> list = proProcessService.selectProProcessList(proProcess);
return AjaxResult.success(list);
}
/**
* 获取工序详细信息
*/
@PreAuthorize("@ss.hasPermi('mes:pro:process:query')")
@GetMapping(value = "/{processId}")
public AjaxResult getInfo(@PathVariable("processId") Long processId)
{
ProProcess p = proProcessService.selectProProcessByProcessId(processId);
if(StringUtils.isNotNull(p)){
return AjaxResult.success(p);
}else{
return AjaxResult.error("未查询到当前工序信息");
}
}
}

View File

@ -114,4 +114,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{recordId}
</foreach>
</delete>
<delete id="deleteByWorkstationId" parameterType="Long">
delete from md_workstation_machine where workstation_id = #{workstationId}
</delete>
</mapper>

View File

@ -114,4 +114,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{recordId}
</foreach>
</delete>
<delete id="deleteByWorkstationId" parameterType="Long">
delete from md_workstation_tool where workstation_id = #{workstationId}
</delete>
</mapper>

View File

@ -114,4 +114,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{recordId}
</foreach>
</delete>
<delete id="deleteByWorkstationId" parameterType="Long">
delete from md_workstation_worker where workstation_id = #{workstationId}
</delete>
</mapper>