保养工单-检验+填写记录

highway
wws 1 year ago
parent 9e14409743
commit 996c45f972

@ -9,6 +9,7 @@ import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.device.domain.EquOrder;
import com.op.device.domain.EquPlan;
import com.op.device.domain.dto.UpKeepOrderDTO;
import com.op.device.service.IEquUpkeepOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -29,6 +30,18 @@ public class EquUpkeepOrderController extends BaseController {
@Autowired
private IEquUpkeepOrderService equUpkeepOrderService;
/**
*
* @param upKeepOrderDTO
* @return
*/
@RequiresPermissions("device:upkeepOrder:add")
@PostMapping("/subInspect")
public AjaxResult subInspect(@RequestBody UpKeepOrderDTO upKeepOrderDTO) {
return equUpkeepOrderService.subInspect(upKeepOrderDTO);
}
/**
*
*/
@ -78,7 +91,7 @@ public class EquUpkeepOrderController extends BaseController {
@Log(title = "保养工单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EquOrder equOrder) {
return toAjax(equUpkeepOrderService.updateEquOrder(equOrder));
return equUpkeepOrderService.updateEquOrder(equOrder);
}
/**

@ -140,6 +140,16 @@ public class EquOrder extends BaseEntity {
// 是否停机保养
private String shutDown;
private String orderInspect;
public String getOrderInspect() {
return orderInspect;
}
public void setOrderInspect(String orderInspect) {
this.orderInspect = orderInspect;
}
public String getShutDown() {
return shutDown;
}

@ -60,6 +60,16 @@ public class EquOrderEqu extends BaseEntity {
private List<EquOrderDetail> detailList;
private List<EquOrderEquSpare> spareList;
public List<EquOrderEquSpare> getSpareList() {
return spareList;
}
public void setSpareList(List<EquOrderEquSpare> spareList) {
this.spareList = spareList;
}
public List<EquOrderDetail> getDetailList() {
return detailList;
}

@ -0,0 +1,26 @@
package com.op.device.domain.dto;
import java.util.List;
// 保养工单DTO
public class UpKeepOrderDTO {
private List<String> ids;
private String inspect;
public String getInspect() {
return inspect;
}
public void setInspect(String inspect) {
this.inspect = inspect;
}
public List<String> getIds() {
return ids;
}
public void setIds(List<String> ids) {
this.ids = ids;
}
}

@ -58,4 +58,11 @@ public interface EquOrderEquSpareMapper {
* @return
*/
public int deleteEquOrderEquSpareByIds(String[] ids);
/**
* list
* @param code
* @return
*/
List<EquOrderEquSpare> selectEquOrderEquSpareByParentCode(String code);
}

@ -3,6 +3,7 @@ package com.op.device.service;
import com.op.common.core.web.domain.AjaxResult;
import com.op.device.domain.EquOrder;
import com.op.device.domain.EquPlan;
import com.op.device.domain.dto.UpKeepOrderDTO;
import java.util.List;
@ -43,7 +44,7 @@ public interface IEquUpkeepOrderService {
* @param equOrder
* @return
*/
public int updateEquOrder(EquOrder equOrder);
public AjaxResult updateEquOrder(EquOrder equOrder);
/**
*
@ -60,4 +61,11 @@ public interface IEquUpkeepOrderService {
* @return
*/
public int deleteEquOrderByOrderId(String orderId);
/**
*
* @param upKeepOrderDTO
* @return
*/
AjaxResult subInspect(UpKeepOrderDTO upKeepOrderDTO);
}

@ -8,14 +8,11 @@ import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.context.SecurityContextHolder;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.device.domain.EquOrderDetail;
import com.op.device.domain.EquOrderEqu;
import com.op.device.domain.EquOrderStandard;
import com.op.device.domain.*;
import com.op.device.mapper.*;
import com.op.system.api.domain.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.device.domain.EquOrder;
import com.op.device.service.IEquOrderService;
import static com.op.common.core.web.domain.AjaxResult.success;
@ -40,6 +37,8 @@ public class EquOrderServiceImpl implements IEquOrderService {
private EquOrderStandardMapper equOrderStandardMapper;
@Autowired
private PersonMapper personMapper;
@Autowired
private EquOrderEquSpareMapper equOrderEquSpareMapper;
/**
*
@ -71,6 +70,11 @@ public class EquOrderServiceImpl implements IEquOrderService {
}
equ.setDetailList(detailList);
List<EquOrderEquSpare> spareList = equOrderEquSpareMapper.selectEquOrderEquSpareByParentCode(equ.getCode());
if (spareList.size()>0) {
equ.setSpareList(spareList);
}
// 人员信息
List<String> users = equOrderPersonMapper.selectEquOrderPersonByOrderCode(orderCode);

@ -6,6 +6,7 @@ import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.device.domain.*;
import com.op.device.domain.dto.UpKeepOrderDTO;
import com.op.device.mapper.*;
import com.op.device.service.IEquUpkeepOrderService;
import com.op.system.api.domain.SysUser;
@ -207,9 +208,26 @@ public class EquUpkeepOrderServiceImpl implements IEquUpkeepOrderService {
*/
@Override
@DS("#header.poolName")
public int updateEquOrder(EquOrder equOrder) {
public AjaxResult updateEquOrder(EquOrder equOrder) {
// 更新保养工单信息
equOrder.setOrderStart(equOrder.getTimeArray().get(0));
equOrder.setOrderEnd(equOrder.getTimeArray().get(1));
equOrder.setUpdateBy(SecurityContextHolder.getUserName());
equOrder.setUpdateTime(DateUtils.getNowDate());
return equOrderMapper.updateEquOrder(equOrder);
equOrderMapper.updateEquOrder(equOrder);
// 更新标准信息
EquOrderEqu equ = equOrder.getEqu();
List<EquOrderDetail> detailList = equ.getDetailList();
for (EquOrderDetail detail : detailList) {
List<EquOrderStandard> standardList = detail.getStandardList();
for (EquOrderStandard standard : standardList) {
standard.setUpdateBy(SecurityContextHolder.getUserName());
standard.setUpdateTime(DateUtils.getNowDate());
equOrderStandardMapper.updateEquOrderStandard(standard);
}
}
return success();
}
/**
@ -235,4 +253,22 @@ public class EquUpkeepOrderServiceImpl implements IEquUpkeepOrderService {
public int deleteEquOrderByOrderId(String orderId) {
return equOrderMapper.deleteEquOrderByOrderId(orderId);
}
/**
*
* @param upKeepOrderDTO
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult subInspect(UpKeepOrderDTO upKeepOrderDTO) {
List<String> ids = upKeepOrderDTO.getIds();
for (String id : ids){
EquOrder order = new EquOrder();
order.setOrderId(id);
order.setOrderInspect(upKeepOrderDTO.getInspect());
equOrderMapper.updateEquOrder(order);
}
return success();
}
}

@ -50,6 +50,11 @@
where id = #{id}
</select>
<select id="selectEquOrderEquSpareByParentCode" parameterType="String" resultMap="EquOrderEquSpareResult">
<include refid="selectEquOrderEquSpareVo"/>
where parent_code = #{parentCode}
</select>
<insert id="insertEquOrderEquSpare" parameterType="EquOrderEquSpare">
insert into equ_order_equ_spare
<trim prefix="(" suffix=")" suffixOverrides=",">

@ -36,10 +36,11 @@
<result property="upkeep" column="upkeep" />
<result property="calculationRule" column="calculation_rule" />
<result property="shutDown" column="shut_down" />
<result property="orderInspect" column="order_inspect" />
</resultMap>
<sql id="selectEquOrderVo">
select order_id, plan_id, plan_code, plan_type, order_code, plan_workshop, plan_prod_line, plan_loop, plan_loop_type, plan_loop_start, plan_loop_end, order_start, order_end, equipment_code, order_status, order_cost, plan_person, order_cost_time, order_sign_person, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time,upkeep,calculation_rule,shut_down from equ_order
select order_id, plan_id, plan_code, plan_type, order_code, plan_workshop, plan_prod_line, plan_loop, plan_loop_type, plan_loop_start, plan_loop_end, order_start, order_end, equipment_code, order_status, order_cost, plan_person, order_cost_time, order_sign_person, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time,upkeep,calculation_rule,shut_down,order_inspect from equ_order
</sql>
<select id="selectEquOrderList" parameterType="EquOrder" resultMap="EquOrderResult">
@ -75,6 +76,7 @@
<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>
<if test="orderInspect != null "> and order_inspect = #{orderInspect}</if>
and del_flag = '0'
</where>
</select>
@ -151,6 +153,7 @@
<if test="upkeep != null">upkeep,</if>
<if test="calculationRule != null">calculation_rule,</if>
<if test="shutDown != null">shut_down,</if>
<if test="orderInspect != null">order_inspect,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderId != null">#{orderId},</if>
@ -184,6 +187,7 @@
<if test="upkeep != null">#{upkeep},</if>
<if test="calculationRule != null">#{calculationRule},</if>
<if test="shutDown != null">#{shutDown},</if>
<if test="orderInspect != null">#{orderInspect},</if>
</trim>
</insert>
@ -220,6 +224,7 @@
<if test="upkeep != null">upkeep = #{upkeep},</if>
<if test="calculationRule != null">calculation_rule = #{calculationRule},</if>
<if test="shutDown != null">shut_down = #{shutDown},</if>
<if test="orderInspect != null">order_inspect = #{orderInspect},</if>
</trim>
where order_id = #{orderId}
</update>

Loading…
Cancel
Save