1.完成设备养护功能

feature-order-fix
x_z 2 years ago
parent 1794802bd7
commit 2e814bfc63

@ -23,4 +23,12 @@ public interface DeviceMaOrderDetailDao {
List<DeviceMAOrderDetailResponse> filterList(FilterDeviceMAOrderDetailRequest detailRequest);
void deleteByOrderId(@Param("orderIdFk") String orderIdFk);
/**
*
*
* @param orderId
* @return
*/
List<DeviceMAOrderDetailEntity> selectByOrderId(@Param("orderId") String orderId);
}

@ -16,4 +16,14 @@ public class FilterDeviceMAOrderRequest extends ListPageRequest {
*/
private String orderId;
/**
*
*/
private String collOrderId;
/**
* 0稿 1
*/
private Integer status;
}

@ -96,6 +96,15 @@ public class DeviceMAOrderServiceImpl implements DeviceMAOrderService {
if (null == deviceMAOrderEntity.getId() || StrUtil.isBlank(deviceMAOrderEntity.getOrderId())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
if (deviceMAOrderEntity.getStatus() == 1) {
//完成养护记录更新,查询此条养护记录详情中是否存在未养护完成设备
List<DeviceMAOrderDetailEntity> detailList = deviceMaOrderDetailDao.selectByOrderId(deviceMAOrderEntity.getOrderId());
for (DeviceMAOrderDetailEntity deviceMAOrderDetailEntity : detailList) {
if (deviceMAOrderDetailEntity.getMaintenanceStatus() == 0) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "存在未养护设备,请完成该设备养护!");
}
}
}
deviceMAOrderDao.updateByPrimaryKey(deviceMAOrderEntity);
return ResultVOUtils.success("更新成功");
}

@ -170,6 +170,6 @@
</select>
<update id="updateStatusById">
update device_collect_order set status = #{status} and id = #{id}
update device_collect_order set status = #{status} where id = #{id}
</update>
</mapper>

@ -150,12 +150,19 @@
</update>
<select id="filterList" resultType="com.glxp.api.admin.entity.inventory.DeviceMAOrderEntity">
select <include refid="Base_Column_List" />
select
<include refid="Base_Column_List"/>
from device_ma_order
<where>
<if test="orderId != null and orderId != ''">
AND orderId like concat('%', #{orderId}, '%')
</if>
<if test="status != null">
AND status = #{status}
</if>
<if test="collOrderId != null and collOrderId != ''">
AND collOrderId like concat('%', #{collOrderId}, '%')
</if>
</where>
</select>
</mapper>

@ -261,4 +261,9 @@
<delete id="deleteByOrderId">
delete from device_ma_order_detail where orderIdFk = #{orderIdFk}
</delete>
<select id="selectByOrderId" resultMap="BaseResultMap">
select <include refid="Base_Column_List" />
from device_ma_order_detail where orderIdFk = #{orderId}
</select>
</mapper>
Loading…
Cancel
Save