点检工单、保养工单init

highway
wws 1 year ago
parent 3491e38ec1
commit a916fe242b

@ -0,0 +1,92 @@
package com.op.device.controller;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.web.page.TableDataInfo;
import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.device.domain.EquOrder;
import com.op.device.service.IEquSpotInspectionOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller
*
* @author wws
* @date 2023-10-31
*/
@RestController
@RequestMapping("/spotInspectionOrder")
public class EquSpotInspectionOrderController extends BaseController {
@Autowired
private IEquSpotInspectionOrderService equSpotInspectionOrderService;
/**
*
*/
@RequiresPermissions("device:spotInspectionOrder:list")
@GetMapping("/list")
public TableDataInfo list(EquOrder equOrder) {
startPage();
List<EquOrder> list = equSpotInspectionOrderService.selectEquOrderList(equOrder);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("device:spotInspectionOrder:export")
@Log(title = "点检工单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EquOrder equOrder) {
List<EquOrder> list = equSpotInspectionOrderService.selectEquOrderList(equOrder);
ExcelUtil<EquOrder> util = new ExcelUtil<EquOrder>(EquOrder.class);
util.exportExcel(response, list, "点检工单数据");
}
/**
*
*/
@RequiresPermissions("device:spotInspectionOrder:query")
@GetMapping(value = "/{orderId}")
public AjaxResult getInfo(@PathVariable("orderId") String orderId) {
return success(equSpotInspectionOrderService.selectEquOrderByOrderId(orderId));
}
/**
*
*/
@RequiresPermissions("device:spotInspectionOrder:add")
@Log(title = "点检工单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EquOrder equOrder) {
return toAjax(equSpotInspectionOrderService.insertEquOrder(equOrder));
}
/**
*
*/
@RequiresPermissions("device:spotInspectionOrder:edit")
@Log(title = "点检工单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EquOrder equOrder) {
return toAjax(equSpotInspectionOrderService.updateEquOrder(equOrder));
}
/**
*
*/
@RequiresPermissions("device:spotInspectionOrder:remove")
@Log(title = "点检工单", businessType = BusinessType.DELETE)
@DeleteMapping("/{orderIds}")
public AjaxResult remove(@PathVariable String[] orderIds) {
return toAjax(equSpotInspectionOrderService.deleteEquOrderByOrderIds(orderIds));
}
}

@ -0,0 +1,92 @@
package com.op.device.controller;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.web.page.TableDataInfo;
import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.device.domain.EquOrder;
import com.op.device.service.IEquUpkeepOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller
*
* @author wws
* @date 2023-10-31
*/
@RestController
@RequestMapping("/upkeepOrder")
public class EquUpkeepOrderController extends BaseController {
@Autowired
private IEquUpkeepOrderService equUpkeepOrderService;
/**
*
*/
@RequiresPermissions("device:upkeepOrder:list")
@GetMapping("/list")
public TableDataInfo list(EquOrder equOrder) {
startPage();
List<EquOrder> list = equUpkeepOrderService.selectEquOrderList(equOrder);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("device:upkeepOrder:export")
@Log(title = "保养工单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EquOrder equOrder) {
List<EquOrder> list = equUpkeepOrderService.selectEquOrderList(equOrder);
ExcelUtil<EquOrder> util = new ExcelUtil<EquOrder>(EquOrder.class);
util.exportExcel(response, list, "保养工单数据");
}
/**
*
*/
@RequiresPermissions("device:upkeepOrder:query")
@GetMapping(value = "/{orderId}")
public AjaxResult getInfo(@PathVariable("orderId") String orderId) {
return success(equUpkeepOrderService.selectEquOrderByOrderId(orderId));
}
/**
*
*/
@RequiresPermissions("device:upkeepOrder:add")
@Log(title = "保养工单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EquOrder equOrder) {
return toAjax(equUpkeepOrderService.insertEquOrder(equOrder));
}
/**
*
*/
@RequiresPermissions("device:upkeepOrder:edit")
@Log(title = "保养工单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EquOrder equOrder) {
return toAjax(equUpkeepOrderService.updateEquOrder(equOrder));
}
/**
*
*/
@RequiresPermissions("device:upkeepOrder:remove")
@Log(title = "保养工单", businessType = BusinessType.DELETE)
@DeleteMapping("/{orderIds}")
public AjaxResult remove(@PathVariable String[] orderIds) {
return toAjax(equUpkeepOrderService.deleteEquOrderByOrderIds(orderIds));
}
}

@ -85,4 +85,11 @@ public interface EquOrderMapper {
* @return
*/
List<EquOrder> selectTaskRecord(int userId);
/**
* id
* @param orderId
* @return
*/
EquOrder selectEquOrderByOrderId(String orderId);
}

@ -0,0 +1,61 @@
package com.op.device.service;
import com.op.device.domain.EquOrder;
import java.util.List;
/**
* Service
*
* @author wws
* @date 2023-10-31
*/
public interface IEquSpotInspectionOrderService {
/**
*
*
* @param orderId
* @return
*/
public EquOrder selectEquOrderByOrderId(String orderId);
/**
*
*
* @param equOrder
* @return
*/
public List<EquOrder> selectEquOrderList(EquOrder equOrder);
/**
*
*
* @param equOrder
* @return
*/
public int insertEquOrder(EquOrder equOrder);
/**
*
*
* @param equOrder
* @return
*/
public int updateEquOrder(EquOrder equOrder);
/**
*
*
* @param orderIds
* @return
*/
public int deleteEquOrderByOrderIds(String[] orderIds);
/**
*
*
* @param orderId
* @return
*/
public int deleteEquOrderByOrderId(String orderId);
}

@ -0,0 +1,61 @@
package com.op.device.service;
import com.op.device.domain.EquOrder;
import java.util.List;
/**
* Service
*
* @author wws
* @date 2023-10-31
*/
public interface IEquUpkeepOrderService {
/**
*
*
* @param orderId
* @return
*/
public EquOrder selectEquOrderByOrderId(String orderId);
/**
*
*
* @param equOrder
* @return
*/
public List<EquOrder> selectEquOrderList(EquOrder equOrder);
/**
*
*
* @param equOrder
* @return
*/
public int insertEquOrder(EquOrder equOrder);
/**
*
*
* @param equOrder
* @return
*/
public int updateEquOrder(EquOrder equOrder);
/**
*
*
* @param orderIds
* @return
*/
public int deleteEquOrderByOrderIds(String[] orderIds);
/**
*
*
* @param orderId
* @return
*/
public int deleteEquOrderByOrderId(String orderId);
}

@ -0,0 +1,96 @@
package com.op.device.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.device.domain.EquOrder;
import com.op.device.mapper.EquOrderMapper;
import com.op.device.service.IEquSpotInspectionOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author wws
* @date 2023-10-31
*/
@Service
public class EquSpotInspectionOrderServiceImpl implements IEquSpotInspectionOrderService {
@Autowired
private EquOrderMapper equOrderMapper;
/**
*
*
* @param orderId
* @return
*/
@Override
@DS("#header.poolName")
public EquOrder selectEquOrderByOrderId(String orderId) {
return equOrderMapper.selectEquOrderByOrderId(orderId);
}
/**
*
*
* @param equOrder
* @return
*/
@Override
@DS("#header.poolName")
public List<EquOrder> selectEquOrderList(EquOrder equOrder) {
return equOrderMapper.selectEquOrderList(equOrder);
}
/**
*
*
* @param equOrder
* @return
*/
@Override
public int insertEquOrder(EquOrder equOrder) {
equOrder.setCreateTime(DateUtils.getNowDate());
return equOrderMapper.insertEquOrder(equOrder);
}
/**
*
*
* @param equOrder
* @return
*/
@Override
@DS("#header.poolName")
public int updateEquOrder(EquOrder equOrder) {
equOrder.setUpdateTime(DateUtils.getNowDate());
return equOrderMapper.updateEquOrder(equOrder);
}
/**
*
*
* @param orderIds
* @return
*/
@Override
@DS("#header.poolName")
public int deleteEquOrderByOrderIds(String[] orderIds) {
return equOrderMapper.deleteEquOrderByOrderIds(orderIds);
}
/**
*
*
* @param orderId
* @return
*/
@Override
@DS("#header.poolName")
public int deleteEquOrderByOrderId(String orderId) {
return equOrderMapper.deleteEquOrderByOrderId(orderId);
}
}

@ -0,0 +1,97 @@
package com.op.device.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.device.domain.EquOrder;
import com.op.device.mapper.EquOrderMapper;
import com.op.device.service.IEquUpkeepOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author wws
* @date 2023-10-31
*/
@Service
public class EquUpkeepOrderServiceImpl implements IEquUpkeepOrderService {
@Autowired
private EquOrderMapper equOrderMapper;
/**
*
*
* @param orderId
* @return
*/
@Override
@DS("#header.poolName")
public EquOrder selectEquOrderByOrderId(String orderId) {
return equOrderMapper.selectEquOrderByOrderId(orderId);
}
/**
*
*
* @param equOrder
* @return
*/
@Override
@DS("#header.poolName")
public List<EquOrder> selectEquOrderList(EquOrder equOrder) {
return equOrderMapper.selectEquOrderList(equOrder);
}
/**
*
*
* @param equOrder
* @return
*/
@Override
@DS("#header.poolName")
public int insertEquOrder(EquOrder equOrder) {
equOrder.setCreateTime(DateUtils.getNowDate());
return equOrderMapper.insertEquOrder(equOrder);
}
/**
*
*
* @param equOrder
* @return
*/
@Override
@DS("#header.poolName")
public int updateEquOrder(EquOrder equOrder) {
equOrder.setUpdateTime(DateUtils.getNowDate());
return equOrderMapper.updateEquOrder(equOrder);
}
/**
*
*
* @param orderIds
* @return
*/
@Override
@DS("#header.poolName")
public int deleteEquOrderByOrderIds(String[] orderIds) {
return equOrderMapper.deleteEquOrderByOrderIds(orderIds);
}
/**
*
*
* @param orderId
* @return
*/
@Override
@DS("#header.poolName")
public int deleteEquOrderByOrderId(String orderId) {
return equOrderMapper.deleteEquOrderByOrderId(orderId);
}
}

@ -75,8 +75,8 @@
<if test="upkeep != null "> and upkeep = #{upkeep}</if>
<if test="calculationRule != null "> and calculation_rule = #{calculationRule}</if>
<if test="shutDown != null "> and shut_down = #{shutDown}</if>
</where>
and del_flag = '0'
</where>
</select>
<select id="selectEquOrderByOrderCode" parameterType="String" resultMap="EquOrderResult">
@ -89,7 +89,7 @@
</select>
<select id="selectCenterNameByCenterCode" resultType="java.lang.String">
select workshop_name from base_equipment where del_flag = '0' and workshop_code = #{planWorkshop}
select top 1 workshop_name from base_equipment where del_flag = '0' and workshop_code = #{planWorkshop}
</select>
<select id="selectTodayTask" resultType="java.lang.Integer" resultMap="EquOrderResult">
@ -106,6 +106,11 @@
)
</select>
<select id="selectEquOrderByOrderId" parameterType="String" resultMap="EquOrderResult">
<include refid="selectEquOrderVo"/>
where order_id = #{orderId}
</select>
<insert id="insertEquOrder" parameterType="EquOrder">
insert into equ_order
<trim prefix="(" suffix=")" suffixOverrides=",">

Loading…
Cancel
Save